[llvm] [InstCombine] Rewrite multi-use GEPs when simplifying comparison (PR #146100)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 28 05:06:41 PDT 2025


https://github.com/dtcxzyw approved this pull request.

LGTM. The only downside is that rewriting of GEPs may lose nuw flags when it is also used by a nuw pointer difference. This pattern is introduced by Rust's intrinsic ` ptr_offset_from_unsigned`. https://doc.rust-lang.org/src/core/ptr/const_ptr.rs.html#772 https://github.com/rust-lang/rust/blob/d41e12f1f4e4884c356f319b881921aa37040de5/compiler/rustc_codegen_ssa/src/mir/intrinsic.rs#L497-L500
https://alive2.llvm.org/ce/z/ALxH4R

https://github.com/llvm/llvm-project/pull/146100


More information about the llvm-commits mailing list