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 a7aa20517c
commit 05a665f21a
7 changed files with 66 additions and 20 deletions

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