[llvm] r334579 - [PowerPC] avoid verification failure due to PowerPC VSX Swap Removal pass

Hiroshi Inoue via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 13 01:25:14 PDT 2018


Author: inouehrs
Date: Wed Jun 13 01:25:14 2018
New Revision: 334579

URL: http://llvm.org/viewvc/llvm-project?rev=334579&view=rev
Log:
[PowerPC] avoid verification failure due to PowerPC VSX Swap Removal pass

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.


Modified:
    llvm/trunk/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp?rev=334579&r1=334578&r2=334579&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp Wed Jun 13 01:25:14 2018
@@ -878,6 +878,12 @@ void PPCVSXSwapRemoval::handleSpecialSwa
     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;




More information about the llvm-commits mailing list