diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-02-01 21:20:58 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-02-01 21:20:58 +0000 |
commit | 83d695419ccb7cb77809509e9dc4ffd597b3cfff (patch) | |
tree | 3418698f59f159fb478da5ad750a7cbea147d7ab /llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | |
parent | ad960019b0e5d5478197949f3f31e36f5a3d2f60 (diff) | |
download | bcm5719-llvm-83d695419ccb7cb77809509e9dc4ffd597b3cfff.tar.gz bcm5719-llvm-83d695419ccb7cb77809509e9dc4ffd597b3cfff.zip |
[PowerPC] Remove the PPCVSXCopyCleanup pass
This MI-level pass was necessary when VSX support was first being developed,
specifically, before the ABI code had been updated to use VSX registers for
arguments (the register assignments did not change, in a physical sense, but
the VSX super-registers are now used). Unfortunately, I never went back and
removed this pass after that was done. I believe this code is now effectively
dead.
llvm-svn: 227767
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp index c1cfc2567c4..b844f63c86f 100644 --- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp @@ -2036,82 +2036,6 @@ FunctionPass* llvm::createPPCVSXCopyPass() { return new PPCVSXCopy(); } #undef DEBUG_TYPE -#define DEBUG_TYPE "ppc-vsx-copy-cleanup" - -namespace llvm { - void initializePPCVSXCopyCleanupPass(PassRegistry&); -} - -namespace { - // PPCVSXCopyCleanup pass - We sometimes end up generating self copies of VSX - // registers (mostly because the ABI code still places all values into the - // "traditional" floating-point and vector registers). Remove them here. - struct PPCVSXCopyCleanup : public MachineFunctionPass { - static char ID; - PPCVSXCopyCleanup() : MachineFunctionPass(ID) { - initializePPCVSXCopyCleanupPass(*PassRegistry::getPassRegistry()); - } - - const TargetInstrInfo *TII; - -protected: - bool processBlock(MachineBasicBlock &MBB) { - bool Changed = false; - - SmallVector<MachineInstr *, 4> ToDelete; - for (MachineBasicBlock::iterator I = MBB.begin(), IE = MBB.end(); - I != IE; ++I) { - MachineInstr *MI = I; - if (MI->getOpcode() == PPC::XXLOR && - MI->getOperand(0).getReg() == MI->getOperand(1).getReg() && - MI->getOperand(0).getReg() == MI->getOperand(2).getReg()) - ToDelete.push_back(MI); - } - - if (!ToDelete.empty()) - Changed = true; - - for (unsigned i = 0, ie = ToDelete.size(); i != ie; ++i) { - DEBUG(dbgs() << "Removing VSX self-copy: " << *ToDelete[i]); - ToDelete[i]->eraseFromParent(); - } - - return Changed; - } - -public: - bool runOnMachineFunction(MachineFunction &MF) override { - // If we don't have VSX don't bother doing anything here. - const PPCSubtarget &STI = MF.getSubtarget<PPCSubtarget>(); - if (!STI.hasVSX()) - return false; - TII = STI.getInstrInfo(); - - bool Changed = false; - - for (MachineFunction::iterator I = MF.begin(); I != MF.end();) { - MachineBasicBlock &B = *I++; - if (processBlock(B)) - Changed = true; - } - - return Changed; - } - - void getAnalysisUsage(AnalysisUsage &AU) const override { - MachineFunctionPass::getAnalysisUsage(AU); - } - }; -} - -INITIALIZE_PASS(PPCVSXCopyCleanup, DEBUG_TYPE, - "PowerPC VSX Copy Cleanup", false, false) - -char PPCVSXCopyCleanup::ID = 0; -FunctionPass* -llvm::createPPCVSXCopyCleanupPass() { return new PPCVSXCopyCleanup(); } - -#undef DEBUG_TYPE #define DEBUG_TYPE "ppc-early-ret" STATISTIC(NumBCLR, "Number of early conditional returns"); STATISTIC(NumBLR, "Number of early returns"); |