Skip to content

Commit 088e03f

Browse files
committed
Lower the assume intrinsic to a MIR statement
1 parent b8169a6 commit 088e03f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/base.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,6 +791,8 @@ fn codegen_stmt<'tcx>(
791791
| StatementKind::Nop
792792
| StatementKind::FakeRead(..)
793793
| StatementKind::Retag { .. }
794+
// We ignore `assume` intrinsics, they are only useful for optimizations
795+
| StatementKind::Assume(..)
794796
| StatementKind::AscribeUserType(..) => {}
795797

796798
StatementKind::Coverage { .. } => fx.tcx.sess.fatal("-Zcoverage is unimplemented"),

src/constant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ pub(crate) fn mir_operand_get_const_val<'tcx>(
540540
return None;
541541
} // conservative handling
542542
StatementKind::Assign(_)
543+
| StatementKind::Assume(_)
543544
| StatementKind::FakeRead(_)
544545
| StatementKind::SetDiscriminant { .. }
545546
| StatementKind::Deinit(_)

src/intrinsics/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,6 @@ fn codegen_regular_intrinsic_call<'tcx>(
357357
let usize_layout = fx.layout_of(fx.tcx.types.usize);
358358

359359
match intrinsic {
360-
sym::assume => {
361-
intrinsic_args!(fx, args => (_a); intrinsic);
362-
}
363360
sym::likely | sym::unlikely => {
364361
intrinsic_args!(fx, args => (a); intrinsic);
365362

0 commit comments

Comments
 (0)