This patch fixes a failure in lnt tests with -verify-machineinstrs option.
When VSX Swap Removal pass swaps two register operands, it did not maintain kill flags associated with operands. This patch swaps flags as well as register number to avoid inconsistent kill flags information.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334579
91177308-0d34-0410-b5e6-
96231b3b80d8
MI->getOperand(1).setReg(Reg2);
MI->getOperand(2).setReg(Reg1);
+ // We also need to swap kill flag associated with the register.
+ bool IsKill1 = MI->getOperand(1).isKill();
+ bool IsKill2 = MI->getOperand(2).isKill();
+ MI->getOperand(1).setIsKill(IsKill2);
+ MI->getOperand(2).setIsKill(IsKill1);
+
LLVM_DEBUG(dbgs() << " Into: ");
LLVM_DEBUG(MI->dump());
break;