diff options
author | Björn Pettersson <bjorn.a.pettersson@ericsson.com> | 2025-04-14 11:03:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-14 11:03:06 +0200 |
commit | 29555ad5efea20308c7a5ee851a4cba9093a607d (patch) | |
tree | f92581961ac7215f96cc2908616678149130b6e1 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | bcd7f54d340c54630a63659e439540891f7efb09 (diff) | |
download | llvm-29555ad5efea20308c7a5ee851a4cba9093a607d.zip llvm-29555ad5efea20308c7a5ee851a4cba9093a607d.tar.gz llvm-29555ad5efea20308c7a5ee851a4cba9093a607d.tar.bz2 |
[InstCombine] Improve inbounds preservation for ADD+GEP -> GEP+GEP (#135155)
Given that we have a "add nuw" and a "getelementptr inbounds nuw" like
this:
%idx = add nuw i64 %idx1, %idx2
%gep = getelementptr inbounds nuw i32, ptr %ptr, i64 %idx
Then we can preserve the "inbounds nuw" flag when transforming that into
two getelementptr instructions:
%gep1 = getelementptr inbounds nuw i32, ptr %ptr, i64 %idx1
%gep = getelementptr inbounds nuw i32, ptr %ptr, i64 %idx2
Similarly for just having "nuw", and "nusw nuw" instead of "inbounds nuw"
on the getelementptr.
Proof: https://alive2.llvm.org/ce/z/QSweWW
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions