Skip to content

Commit

Permalink
Lower intrinsics::offset to mir::BinOp::Offset
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
scottmcm committed Apr 26, 2023
1 parent b908472 commit 065d81a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/intrinsics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 065d81a

Please sign in to comment.