[all-commits] [llvm/llvm-project] 6f98b3: [AMDGPU][SDAG] DAGCombine PTRADD -> disjoint OR
Fabian Ritter via All-commits
all-commits at lists.llvm.org
Fri Jul 18 01:11:01 PDT 2025
Branch: refs/heads/users/ritter-x2a/06-27-_amdgpu_sdag_dagcombine_ptradd_-_disjoint_or
Home: https://github.com/llvm/llvm-project
Commit: 6f98b3a7b6207c50e13d1a549e2098d93875be7b
https://github.com/llvm/llvm-project/commit/6f98b3a7b6207c50e13d1a549e2098d93875be7b
Author: Fabian Ritter <fabian.ritter at amd.com>
Date: 2025-07-18 (Fri, 18 Jul 2025)
Changed paths:
M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
M llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll
Log Message:
-----------
[AMDGPU][SDAG] DAGCombine PTRADD -> disjoint OR
If we can't fold a PTRADD's offset into its users, lowering them to
disjoint ORs is preferable: Often, a 32-bit OR instruction suffices
where we'd otherwise use a pair of 32-bit additions with carry.
This needs to be a DAGCombine (and not a selection rule) because its
main purpose is to enable subsequent DAGCombines for bitwise operations.
We don't want to just turn PTRADDs into disjoint ORs whenever that's
sound because this transform loses the information that the operation
implements pointer arithmetic, which we will soon need to fold offsets
into FLAT instructions. Currently, disjoint ORs can still be used for
offset folding, so that part of the logic can't be tested.
The PR contains a hacky workaround for a situation where an AssertAlign
operand of a PTRADD is not DAGCombined before the PTRADD, causing the
PTRADD to be turned into a disjoint OR although reassociating it with
the operand of the AssertAlign would be better. This wouldn't be a
problem if the DAGCombiner ensured that a node is only processed after
all its operands have been processed.
For SWDEV-516125.
Commit: 8be2fb1e0fd1108873caff68c7c3566131ce0dcd
https://github.com/llvm/llvm-project/commit/8be2fb1e0fd1108873caff68c7c3566131ce0dcd
Author: Fabian Ritter <fabian.ritter at amd.com>
Date: 2025-07-18 (Fri, 18 Jul 2025)
Changed paths:
M llvm/test/CodeGen/AMDGPU/ptradd-sdag-optimizations.ll
Log Message:
-----------
Remove unnecessary attributes in test
Commit: 44a37868de3a4d3ffc5971a00f5854693d696d21
https://github.com/llvm/llvm-project/commit/44a37868de3a4d3ffc5971a00f5854693d696d21
Author: Fabian Ritter <fabian.ritter at amd.com>
Date: 2025-07-18 (Fri, 18 Jul 2025)
Changed paths:
M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
M llvm/lib/Target/AMDGPU/SIISelLowering.cpp
Log Message:
-----------
Move ptradd -> disjoint OR combine to generic combines
Compare: https://github.com/llvm/llvm-project/compare/f7b627f5bb3b...44a37868de3a
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