diff options
author | Stefan Pintilie <stefanp@ca.ibm.com> | 2017-10-30 19:55:38 +0000 |
---|---|---|
committer | Stefan Pintilie <stefanp@ca.ibm.com> | 2017-10-30 19:55:38 +0000 |
commit | 6262fd4b0a310d3afdb1457109f9aaad9d1aa928 (patch) | |
tree | ac17623a59cd15dc5c599de96b71eab56e581c9b /llvm/lib | |
parent | 25d20ba2ddd044f99e28450d519653e68ea323d0 (diff) | |
download | bcm5719-llvm-6262fd4b0a310d3afdb1457109f9aaad9d1aa928.tar.gz bcm5719-llvm-6262fd4b0a310d3afdb1457109f9aaad9d1aa928.zip |
Revert "[PowerPC] Try to simplify a Swap if it feeds a Splat"
Revert r316478.
A test case has failed.
Will recommit this change once we find and fix the failure.
This reverts commit 7c330fabaedaba3d02c58bc3cc1198896c895f34.
llvm-svn: 316952
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp index beb40992900..80b7ac24345 100644 --- a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp +++ b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp @@ -375,53 +375,6 @@ bool PPCMIPeephole::simplifyCode(void) { MI.getOperand(2).setImm(NewElem); } } - - // Splat is fed by a SWAP which is a permute of this form - // XXPERMDI %VA, %VA, 2 - // Since the splat instruction can use any of the vector elements to do - // the splat we do not have to rearrange the elements in the vector - // with a swap before we do the splat. We can simply do the splat from - // a different index. - // If the swap has only one use (the splat) then we can completely - // remove the swap too. - if (DefOpcode == PPC::XXPERMDI && MI.getOperand(1).isImm()) { - unsigned SwapRes = DefMI->getOperand(0).getReg(); - unsigned SwapOp1 = DefMI->getOperand(1).getReg(); - unsigned SwapOp2 = DefMI->getOperand(2).getReg(); - unsigned SwapImm = DefMI->getOperand(3).getImm(); - unsigned SplatImm = MI.getOperand(1).getImm(); - - // Break if this permute is not a swap. - if (SwapOp1 != SwapOp2 || SwapImm != 2) - break; - - unsigned NewElem = 0; - // Compute the new index to use for the splat. - if (MI.getOpcode() == PPC::VSPLTB) - NewElem = (SplatImm + 8) & 0xF; - else if (MI.getOpcode() == PPC::VSPLTH) - NewElem = (SplatImm + 4) & 0x7; - else if (MI.getOpcode() == PPC::XXSPLTW) - NewElem = (SplatImm + 2) & 0x3; - else { - DEBUG(dbgs() << "Unknown splat opcode."); - DEBUG(MI.dump()); - break; - } - - if (MRI->hasOneNonDBGUse(SwapRes)) { - DEBUG(dbgs() << "Removing redundant swap: "); - DEBUG(DefMI->dump()); - ToErase = DefMI; - } - Simplified = true; - DEBUG(dbgs() << "Changing splat immediate from " << SplatImm << - " to " << NewElem << " in instruction: "); - DEBUG(MI.dump()); - MI.getOperand(1).setImm(NewElem); - MI.getOperand(2).setReg(SwapOp1); - } - break; } case PPC::XVCVDPSP: { |