Skip to content

Commit

Permalink
Auto merge of #137271 - nikic:gep-nuw-2, r=scottmcm
Browse files Browse the repository at this point in the history
Emit getelementptr inbounds nuw for pointer::add()

Lower pointer::add (via intrinsic::offset with unsigned offset) to getelementptr inbounds nuw on LLVM versions that support it. This lets LLVM make use of the pre-condition that the offset addition does not wrap in an unsigned sense. Together with inbounds, this also implies that the offset is non-negative.

Fixes rust-lang/rust#137217.
  • Loading branch information
bors committed Feb 24, 2025
2 parents b2be990 + b219a0e commit f73bcd1
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit f73bcd1

Please sign in to comment.