[llvm] [AMDGPU] Recognize more trivially disjoint LDS memory accesses (PR #191599)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 11 14:20:36 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 79c842bf0..4815a0284 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -535,8 +535,7 @@ bool SIInstrInfo::getMemOperandsWithOffsetWidth(
 
 static bool getBasePtrAndOffset(const MachineInstr &MI,
                                 const MachineMemOperand &MMO,
-                                const Value *&Base,
-                                int64_t &Offset) {
+                                const Value *&Base, int64_t &Offset) {
   Offset = MMO.getOffset();
   Base = nullptr;
 
@@ -544,8 +543,9 @@ static bool getBasePtrAndOffset(const MachineInstr &MI,
   if (!V)
     return false;
 
-  Base = GetPointerBaseWithConstantOffset(V, Offset, MI.getMF()->getDataLayout(),
-                                          /*AllowNonInbounds=*/true);
+  Base =
+      GetPointerBaseWithConstantOffset(V, Offset, MI.getMF()->getDataLayout(),
+                                       /*AllowNonInbounds=*/true);
   if (!Base)
     return false;
 
@@ -557,8 +557,7 @@ static bool memOperandsHaveSameBasePtr(const MachineInstr &MI1,
                                        const MachineMemOperand &MMO1,
                                        const MachineInstr &MI2,
                                        const MachineMemOperand &MMO2,
-                                       int64_t *Offset1,
-                                       int64_t *Offset2) {
+                                       int64_t *Offset1, int64_t *Offset2) {
   if (MMO1.getAddrSpace() != MMO2.getAddrSpace())
     return false;
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/191599


More information about the llvm-commits mailing list