[llvm] [AMDGPU][GlobalISel] Fix issue with copy_scc_vcc on gfx7 (PR #165355)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 28 01:06:02 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/AMDGPUInstructionSelector.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/AMDGPUInstructionSelector.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
index 106660170..dec6f4272 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
@@ -225,10 +225,9 @@ bool AMDGPUInstructionSelector::selectCOPY_SCC_VCC(MachineInstr &I) const {
   MachineInstr *Cmp;
 
   if (STI.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS) {
-    unsigned CmpOpc = STI.isWave64() ? AMDGPU::S_CMP_LG_U64 : AMDGPU::S_CMP_LG_U32;
-    Cmp = BuildMI(*BB, &I, DL, TII.get(CmpOpc))
-              .addReg(VCCReg)
-              .addImm(0);
+    unsigned CmpOpc =
+        STI.isWave64() ? AMDGPU::S_CMP_LG_U64 : AMDGPU::S_CMP_LG_U32;
+    Cmp = BuildMI(*BB, &I, DL, TII.get(CmpOpc)).addReg(VCCReg).addImm(0);
   } else {
     // For gfx7 and earlier, S_CMP_LG_U64 doesn't exist, so we use S_OR_B64
     // which sets SCC as a side effect.

``````````

</details>


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


More information about the llvm-commits mailing list