[InstCombine] Check nowrap flags when folding comparison of GEPs with the same base...
commit9725595f3acc0c1aaa354e15ac4ee2b1f8ff4cc9
authorYingwei Zheng <dtcxzyw2333@gmail.com>
Sat, 1 Feb 2025 12:41:15 +0000 (1 20:41 +0800)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2025 12:41:15 +0000 (1 20:41 +0800)
tree7435b3b0d5418f2240e16aa3613f8619671200f0
parent7612dcc6e8d8e7f19b364084effbb01946294720
[InstCombine] Check nowrap flags when folding comparison of GEPs with the same base pointer (#121892)

Alive2: https://alive2.llvm.org/ce/z/P5XbMx
Closes https://github.com/llvm/llvm-project/issues/121890

TODO: It is still safe to perform this transform without nowrap flags if
the corresponding scale factor is 1 byte:
https://alive2.llvm.org/ce/z/J-JCJd
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Transforms/InstCombine/opaque-ptr.ll