[llvm] [AMDGPU][CodeGen] Use COPY instead of V_MOV for non-imm operand (PR #185754)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 10 13:53:06 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/CodeGen/MachineCopyPropagation.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 c57cdbe26..f74e7d7fb 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -9327,14 +9327,18 @@ void SIInstrInfo::movePackToVALU(SIInstrWorklist &Worklist,
Register SrcReg0, SrcReg1;
if (!Src0.isReg() || !RI.isVGPR(MRI, Src0.getReg())) {
SrcReg0 = MRI.createVirtualRegister(&AMDGPU::VGPR_32RegClass);
- BuildMI(*MBB, Inst, DL, get(Src0.isImm() ? AMDGPU::V_MOV_B32_e32 : AMDGPU::COPY), SrcReg0).add(Src0);
+ BuildMI(*MBB, Inst, DL,
+ get(Src0.isImm() ? AMDGPU::V_MOV_B32_e32 : AMDGPU::COPY), SrcReg0)
+ .add(Src0);
} else {
SrcReg0 = Src0.getReg();
}
if (!Src1.isReg() || !RI.isVGPR(MRI, Src1.getReg())) {
SrcReg1 = MRI.createVirtualRegister(&AMDGPU::VGPR_32RegClass);
- BuildMI(*MBB, Inst, DL, get(Src1.isImm() ? AMDGPU::V_MOV_B32_e32 : AMDGPU::COPY), SrcReg1).add(Src1);
+ BuildMI(*MBB, Inst, DL,
+ get(Src1.isImm() ? AMDGPU::V_MOV_B32_e32 : AMDGPU::COPY), SrcReg1)
+ .add(Src1);
} else {
SrcReg1 = Src1.getReg();
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/185754
More information about the llvm-commits
mailing list