llvm-project
1c298c92 - [InstCombine] Preserve nuw flags when merging geps

Commit
1 year ago
[InstCombine] Preserve nuw flags when merging geps These transforms all perform a variant of (gep (gep p, x), y) to (gep p, (x + y)). We can preserve both inbounds and nuw during such transforms (https://alive2.llvm.org/ce/z/Stu4cN), but not nusw, which would require proving that the new add is nsw. For the constant offset case, I've conservatively retained the logic that checks for negative intermediate offsets, though I'm not sure it's still reachable nowadays.
Author
Committer
Parents
Loading