[llvm] [AMDGPU][LRO] LRO fix PHI same-BB filter; treat i8/i16 binops as profitable (PR #155800)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 28 02:30:40 PDT 2025
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/AMDGPULateCodeGenPrepare.cpp
``````````
: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/AMDGPULateCodeGenPrepare.cpp b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
index e4866405c..910da2be8 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp
@@ -128,7 +128,8 @@ public:
bool isOpLegal(Instruction *I) {
if (auto *Intr = dyn_cast<IntrinsicInst>(I))
- return true; // FIXME: narrow to known native intrinsics (DOT/MFMA/tbuffer) or use TTI cost.
+ return true; // FIXME: narrow to known native intrinsics
+ // (DOT/MFMA/tbuffer) or use TTI cost.
// Any store is a profitable sink (prevents flip-flopping)
if (isa<StoreInst>(I))
@@ -139,7 +140,8 @@ public:
if (auto *VTy = dyn_cast<VectorType>(BO->getType())) {
Type *Elt = VTy->getElementType();
// Treat small-int vector binops as profitable when SDWA is available.
- // We explicitly gate to 8/16-bit to avoid i1 vectors and keep behavior tight.
+ // We explicitly gate to 8/16-bit to avoid i1 vectors and keep behavior
+ // tight.
if ((Elt->isIntegerTy(8) || (Elt->isIntegerTy(16)) && ST.hasSDWA())) {
switch (BO->getOpcode()) {
case Instruction::Add:
@@ -182,8 +184,8 @@ public:
// Allow same-BB non-lookthrough users when the def is a PHI:
// loop headers frequently consume the carried value in the header block
- // (e.g. byte-wise vector binops). We *do* want to coerce across the backedge
- // in that common case to enable packed i32 + SDWA lowering.
+ // (e.g. byte-wise vector binops). We *do* want to coerce across the
+ // backedge in that common case to enable packed i32 + SDWA lowering.
if (CII->getParent() == II->getParent() && !IsLookThru(CII) &&
!isa<PHINode>(II))
continue;
``````````
</details>
https://github.com/llvm/llvm-project/pull/155800
More information about the llvm-commits
mailing list