From: James Molloy Date: Mon, 13 Feb 2017 14:07:25 +0000 (+0000) Subject: [ARM] Register ConstantIslands with the pass manager X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6283084264af077479b7fd1f01c0baaab4a6540b;p=llvm [ARM] Register ConstantIslands with the pass manager This allows us to use -stop-before/-stop-after/-run-pass - we can now write .mir tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294948 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/ARM.h b/lib/Target/ARM/ARM.h index 76227bc28e2..39f7988200e 100644 --- a/lib/Target/ARM/ARM.h +++ b/lib/Target/ARM/ARM.h @@ -53,6 +53,7 @@ std::vector computeAllBlockSizes(MachineFunction *MF); void initializeARMLoadStoreOptPass(PassRegistry &); void initializeARMPreAllocLoadStoreOptPass(PassRegistry &); +void initializeARMConstantIslandsPass(PassRegistry &); } // end namespace llvm diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index 46262fd138c..b3ae63a35f6 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -56,6 +56,8 @@ using namespace llvm; #define DEBUG_TYPE "arm-cp-islands" +#define ARM_CP_ISLANDS_OPT_NAME \ + "ARM constant island placement and branch shortening pass" STATISTIC(NumCPEs, "Number of constpool entries"); STATISTIC(NumSplit, "Number of uncond branches inserted"); STATISTIC(NumCBrFixed, "Number of cond branches fixed"); @@ -230,7 +232,7 @@ namespace { } StringRef getPassName() const override { - return "ARM constant island placement and branch shortening pass"; + return ARM_CP_ISLANDS_OPT_NAME; } private: @@ -2283,3 +2285,6 @@ adjustJTTargetBlockForward(MachineBasicBlock *BB, MachineBasicBlock *JTBB) { FunctionPass *llvm::createARMConstantIslandPass() { return new ARMConstantIslands(); } + +INITIALIZE_PASS(ARMConstantIslands, "arm-cp-islands", ARM_CP_ISLANDS_OPT_NAME, + false, false) diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp index 4ee070ebb7a..98862d30fc4 100644 --- a/lib/Target/ARM/ARMTargetMachine.cpp +++ b/lib/Target/ARM/ARMTargetMachine.cpp @@ -87,6 +87,7 @@ extern "C" void LLVMInitializeARMTarget() { initializeGlobalISel(Registry); initializeARMLoadStoreOptPass(Registry); initializeARMPreAllocLoadStoreOptPass(Registry); + initializeARMConstantIslandsPass(Registry); } static std::unique_ptr createTLOF(const Triple &TT) {