diff options
| author | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2018-06-13 08:25:14 +0000 |
|---|---|---|
| committer | Hiroshi Inoue <inouehrs@jp.ibm.com> | 2018-06-13 08:25:14 +0000 |
| commit | 9bffc94cf0741a3308e7b8304f044c604fc3d749 (patch) | |
| tree | 0df2f0ff860b30c5a186b89502badc185da94501 /llvm/lib | |
| parent | 4adc88ed25b313b1dc6594f3b00d1a206f5449b6 (diff) | |
| download | bcm5719-llvm-9bffc94cf0741a3308e7b8304f044c604fc3d749.tar.gz bcm5719-llvm-9bffc94cf0741a3308e7b8304f044c604fc3d749.zip | |
[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.
llvm-svn: 334579
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp b/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp index 2fe54a88b65..1e8a1750ec3 100644 --- a/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp +++ b/llvm/lib/Target/PowerPC/PPCVSXSwapRemoval.cpp @@ -878,6 +878,12 @@ void PPCVSXSwapRemoval::handleSpecialSwappables(int EntryIdx) { 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; |

