[llvm-branch-commits] [llvm] [AMDGPU][SDAG] DAGCombine PTRADD -> disjoint OR (PR #146075)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Aug 1 18:53:13 PDT 2025
================
@@ -2767,6 +2767,19 @@ SDValue DAGCombiner::visitPTRADD(SDNode *N) {
}
}
+ // Transform (ptradd a, b) -> (or disjoint a, b) if it is equivalent and if
+ // that transformation can't block an offset folding at any use of the ptradd.
+ // This should be done late, after legalization, so that it doesn't block
+ // other ptradd combines that could enable more offset folding.
+ if (LegalOperations && DAG.haveNoCommonBitsSet(N0, N1)) {
+ bool TransformCanBreakAddrMode = any_of(N->users(), [&](SDNode *User) {
+ return canFoldInAddressingMode(N, User, DAG, TLI);
+ });
+
+ if (!TransformCanBreakAddrMode)
----------------
arsenm wrote:
!any_of -> none_of
https://github.com/llvm/llvm-project/pull/146075
More information about the llvm-branch-commits
mailing list