[all-commits] [llvm/llvm-project] ab8e33: [InstCombine] Pre-commit tests related to ADDLIKE+...
Björn Pettersson via All-commits
all-commits at lists.llvm.org
Thu Apr 10 03:29:09 PDT 2025
Branch: refs/heads/users/bjope/addlikegep
Home: https://github.com/llvm/llvm-project
Commit: ab8e330be6b3169a102a7655031b7a277fe75b81
https://github.com/llvm/llvm-project/commit/ab8e330be6b3169a102a7655031b7a277fe75b81
Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2025-04-10 (Thu, 10 Apr 2025)
Changed paths:
M llvm/test/Transforms/InstCombine/array.ll
Log Message:
-----------
[InstCombine] Pre-commit tests related to ADDLIKE+GEP->GEP+GEP. NFC
InstCombine can transform ADD+GEP into GEP+GEP. But those rewrites
does not currently trigger when the ADD is a disjoint OR (which
happens to be the canonical form for certain ADD operations). Add
lit tests to show that we are lacking such rewrites.
Also add a test case showing that we do not preserve "inbounds nuw"
and "nuw" when doing such transforms and the ADD/OR is known to be
NUW.
Commit: ed9952ed26a9e15edf2f83a75c220988c4c1928c
https://github.com/llvm/llvm-project/commit/ed9952ed26a9e15edf2f83a75c220988c4c1928c
Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2025-04-10 (Thu, 10 Apr 2025)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
M llvm/test/Transforms/InstCombine/array.ll
Log Message:
-----------
[InstCombine] Improve inbounds preservation for ADD+GEP -> GEP+GEP
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" instead of "inbounds nuw" on the
getelementptr.
Proof: https://alive2.llvm.org/ce/z/4uhfDq
Commit: 1df32f312cac7991adf830cb007008dffa26db47
https://github.com/llvm/llvm-project/commit/1df32f312cac7991adf830cb007008dffa26db47
Author: Bjorn Pettersson <bjorn.a.pettersson at ericsson.com>
Date: 2025-04-10 (Thu, 10 Apr 2025)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
M llvm/test/Transforms/InstCombine/array.ll
M llvm/test/Transforms/InstCombine/gep-merge-constant-indices.ll
M llvm/test/Transforms/InstCombine/gep-vector.ll
M llvm/test/Transforms/InstCombine/vscale_gep.ll
M llvm/test/Transforms/LoopUnroll/runtime-multiexit-heuristic.ll
M llvm/test/Transforms/LoopVectorize/ARM/mve-reductions.ll
M llvm/test/Transforms/LoopVectorize/SystemZ/addressing.ll
M llvm/test/Transforms/LoopVectorize/X86/float-induction-x86.ll
M llvm/test/Transforms/LoopVectorize/X86/interleaving.ll
M llvm/test/Transforms/LoopVectorize/X86/parallel-loops.ll
M llvm/test/Transforms/LoopVectorize/X86/small-size.ll
M llvm/test/Transforms/LoopVectorize/consecutive-ptr-uniforms.ll
M llvm/test/Transforms/LoopVectorize/float-induction.ll
M llvm/test/Transforms/LoopVectorize/forked-pointers.ll
M llvm/test/Transforms/LoopVectorize/induction.ll
M llvm/test/Transforms/LoopVectorize/interleaved-accesses.ll
M llvm/test/Transforms/LoopVectorize/reduction-inloop-cond.ll
M llvm/test/Transforms/LoopVectorize/reduction-inloop-pred.ll
M llvm/test/Transforms/LoopVectorize/reduction-inloop-uf4.ll
M llvm/test/Transforms/LoopVectorize/reduction-predselect.ll
Log Message:
-----------
[InstCombine] Handle "add like" in ADD+GEP->GEP+GEP rewrites
Considering that "or disjoint" is that canonical for certain
add operations, then I think we want to support such "add like"
operations when doing ADD+GEP->GEP+GEP rewrites to make things
more consistent.
Compare: https://github.com/llvm/llvm-project/compare/ab8e330be6b3%5E...1df32f312cac
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list