diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCMIPeephole.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp index 5b7761f..af35669 100644 --- a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp +++ b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp @@ -641,6 +641,18 @@ bool PPCMIPeephole::simplifyCode() { DefMI->getOperand(0).setReg(MI.getOperand(0).getReg()); LLVM_DEBUG(dbgs() << "Removing redundant splat: "); LLVM_DEBUG(MI.dump()); + } else if (Immed == 2 && + (DefOpc == PPC::VSPLTB || DefOpc == PPC::VSPLTH || + DefOpc == PPC::VSPLTW || DefOpc == PPC::XXSPLTW)) { + // Swap of various vector splats, convert to copy. + ToErase = &MI; + Simplified = true; + LLVM_DEBUG(dbgs() << "Optimizing swap(vsplt[b|h|w]|xxspltw) => " + "copy(vsplt[b|h|w]|xxspltw): "); + LLVM_DEBUG(MI.dump()); + BuildMI(MBB, &MI, MI.getDebugLoc(), TII->get(PPC::COPY), + MI.getOperand(0).getReg()) + .add(MI.getOperand(1)); } break; } |