From bef1c56724dbb566af0f0ce18fc30cf43ba82fda Mon Sep 17 00:00:00 2001 From: Krzysztof Parzyszek Date: Mon, 30 Oct 2017 14:11:52 +0000 Subject: [PATCH] [Hexagon] Allow the RDF optimizations to be run in .mir testcases llvm-svn: 316904 --- llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp | 10 +++++----- llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp b/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp index 279b213..c73a230 100644 --- a/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp +++ b/llvm/lib/Target/Hexagon/HexagonRDFOpt.cpp @@ -55,9 +55,7 @@ namespace { class HexagonRDFOpt : public MachineFunctionPass { public: - HexagonRDFOpt() : MachineFunctionPass(ID) { - initializeHexagonRDFOptPass(*PassRegistry::getPassRegistry()); - } + HexagonRDFOpt() : MachineFunctionPass(ID) {} void getAnalysisUsage(AnalysisUsage &AU) const override { AU.addRequired(); @@ -104,10 +102,12 @@ struct HexagonDCE : public DeadCodeElimination { char HexagonRDFOpt::ID = 0; -INITIALIZE_PASS_BEGIN(HexagonRDFOpt, "rdfopt", "Hexagon RDF opt", false, false) +INITIALIZE_PASS_BEGIN(HexagonRDFOpt, "hexagon-rdf-opt", + "Hexagon RDF optimizations", false, false) INITIALIZE_PASS_DEPENDENCY(MachineDominatorTree) INITIALIZE_PASS_DEPENDENCY(MachineDominanceFrontier) -INITIALIZE_PASS_END(HexagonRDFOpt, "rdfopt", "Hexagon RDF opt", false, false) +INITIALIZE_PASS_END(HexagonRDFOpt, "hexagon-rdf-opt", + "Hexagon RDF optimizations", false, false) bool HexagonCP::interpretAsCopy(const MachineInstr *MI, EqualityMap &EM) { auto mapRegs = [&EM] (RegisterRef DstR, RegisterRef SrcR) -> void { diff --git a/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp b/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp index a66e212..683fdea 100644 --- a/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp +++ b/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp @@ -132,6 +132,7 @@ namespace llvm { void initializeHexagonNewValueJumpPass(PassRegistry&); void initializeHexagonOptAddrModePass(PassRegistry&); void initializeHexagonPacketizerPass(PassRegistry&); + void initializeHexagonRDFOptPass(PassRegistry&); Pass *createHexagonLoopIdiomPass(); Pass *createHexagonVectorLoopCarriedReusePass(); @@ -191,6 +192,7 @@ extern "C" void LLVMInitializeHexagonTarget() { initializeHexagonNewValueJumpPass(PR); initializeHexagonOptAddrModePass(PR); initializeHexagonPacketizerPass(PR); + initializeHexagonRDFOptPass(PR); } HexagonTargetMachine::HexagonTargetMachine(const Target &T, const Triple &TT, -- 2.7.4