[llvm] [AMDGPU] Switch V_CNDMASK operands to shrink it into VOP2 (PR #135162)

Mirko BrkuĊĦanin via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 14 05:31:51 PDT 2025


================
@@ -944,20 +960,23 @@ void swapCndOperands(MachineInstr &MI) {
     MI.getOperand(2).ChangeToImmediate(Op4.getImm());
   }
 
-  MachineOperand Op1 = MI.getOperand(1);
-  MachineOperand Op3 = MI.getOperand(3);
-  MI.getOperand(1).setImm(Op3.getImm());
-  MI.getOperand(3).setImm(Op1.getImm());
+  auto Op1Imm = MI.getOperand(1).getImm();
+  auto Op3Imm = MI.getOperand(3).getImm();
+  MI.getOperand(1).setImm(Op3Imm);
+  MI.getOperand(3).setImm(Op1Imm);
 }
 
 Register SIShrinkInstructions::trySwapCndOperands(MachineInstr &MI) const {
   Register Reg = MI.getOperand(0).getReg();
 
+  dbgs() << "cmp : \n";
+  MI.dump();
----------------
mbrkusanin wrote:

remove debug code

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


More information about the llvm-commits mailing list