From 065d81ac6f8ab8dbc8bd39fc672bf821282d556e Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Tue, 25 Apr 2023 12:10:55 -0700 Subject: [PATCH] Lower `intrinsics::offset` to `mir::BinOp::Offset` They're semantically the same, so this means the backends don't need to handle the intrinsic and means fewer MIR basic blocks in pointer arithmetic code. --- src/intrinsics/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/intrinsics/mod.rs b/src/intrinsics/mod.rs index 03f2a65fcca..90b36c61114 100644 --- a/src/intrinsics/mod.rs +++ b/src/intrinsics/mod.rs @@ -534,7 +534,7 @@ fn codegen_regular_intrinsic_call<'tcx>( // The only difference between offset and arith_offset is regarding UB. Because Cranelift // doesn't have UB both are codegen'ed the same way - sym::offset | sym::arith_offset => { + sym::arith_offset => { intrinsic_args!(fx, args => (base, offset); intrinsic); let offset = offset.load_scalar(fx);