================
@@ -241,27 +241,30 @@ void
SIShrinkInstructions::copyExtraImplicitOps(MachineInstr &NewMI,
}
}
-void SIShrinkInstructions::shrinkScalarCompare(MachineInstr &MI) const {
+bool SIShrinkInstructions::shrinkScalarCompare(MachineInstr &MI) const {
if (!ST->hasSCmpK())
- return;
+ return false;
// cmpk instructions do scc = dst <cc op> imm16, so commute the instruction
to
// get constants on the RHS.
- if (!MI.getOperand(0).isReg())
- TII->commuteInstruction(MI, false, 0, 1);
+ bool Changed = false;
+ if (!MI.getOperand(0).isReg()) {
+ if (TII->commuteInstruction(MI, false, 0, 1))
+ Changed = true;
----------------
jayfoad wrote:
```suggestion
Changed |= TII->commuteInstruction(MI, false, 0, 1);
```
https://github.com/llvm/llvm-project/pull/168833
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits