Lower the assume intrinsic to a MIR statement

This commit is contained in:
Oli Scherer 2022-06-30 08:16:05 +00:00
parent b8169a6da0
commit 088e03fe22
3 changed files with 3 additions and 3 deletions

View File

@ -791,6 +791,8 @@ fn is_fat_ptr<'tcx>(fx: &FunctionCx<'_, '_, 'tcx>, ty: Ty<'tcx>) -> bool {
| StatementKind::Nop
| StatementKind::FakeRead(..)
| StatementKind::Retag { .. }
// We ignore `assume` intrinsics, they are only useful for optimizations
| StatementKind::Assume(..)
| StatementKind::AscribeUserType(..) => {}
StatementKind::Coverage { .. } => fx.tcx.sess.fatal("-Zcoverage is unimplemented"),

View File

@ -540,6 +540,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
return None;
} // conservative handling
StatementKind::Assign(_)
| StatementKind::Assume(_)
| StatementKind::FakeRead(_)
| StatementKind::SetDiscriminant { .. }
| StatementKind::Deinit(_)

View File

@ -357,9 +357,6 @@ fn codegen_regular_intrinsic_call<'tcx>(
let usize_layout = fx.layout_of(fx.tcx.types.usize);
match intrinsic {
sym::assume => {
intrinsic_args!(fx, args => (_a); intrinsic);
}
sym::likely | sym::unlikely => {
intrinsic_args!(fx, args => (a); intrinsic);