aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorBjörn Pettersson <bjorn.a.pettersson@ericsson.com>2025-04-14 11:03:06 +0200
committerGitHub <noreply@github.com>2025-04-14 11:03:06 +0200
commit29555ad5efea20308c7a5ee851a4cba9093a607d (patch)
treef92581961ac7215f96cc2908616678149130b6e1 /clang/lib/CodeGen/CodeGenModule.cpp
parentbcd7f54d340c54630a63659e439540891f7efb09 (diff)
downloadllvm-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