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.
This commit is contained in:
Scott McMurray 2023-04-25 12:10:55 -07:00
parent b908472a93
commit 065d81ac6f

View File

@ -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);