]> granicus.if.org Git - llvm/commitdiff
[ARM] Register ConstantIslands with the pass manager
authorJames Molloy <james.molloy@arm.com>
Mon, 13 Feb 2017 14:07:25 +0000 (14:07 +0000)
committerJames Molloy <james.molloy@arm.com>
Mon, 13 Feb 2017 14:07:25 +0000 (14:07 +0000)
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

lib/Target/ARM/ARM.h
lib/Target/ARM/ARMConstantIslandPass.cpp
lib/Target/ARM/ARMTargetMachine.cpp

index 76227bc28e27a543912226fe2b7f13b66037eb61..39f7988200ea8904e09e531dd5c46ae62e8e3ba3 100644 (file)
@@ -53,6 +53,7 @@ std::vector<BasicBlockInfo> computeAllBlockSizes(MachineFunction *MF);
 
 void initializeARMLoadStoreOptPass(PassRegistry &);
 void initializeARMPreAllocLoadStoreOptPass(PassRegistry &);
+void initializeARMConstantIslandsPass(PassRegistry &);
 
 } // end namespace llvm
 
index 46262fd138c58a298fe2e3bb7b0b3f02f0befa1f..b3ae63a35f6654292e31544085f2bd983a08b742 100644 (file)
@@ -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)
index 4ee070ebb7a9ad94b3979b5bb462c29c03c49518..98862d30fc49cbebf0da79efa5757dff8c4871b9 100644 (file)
@@ -87,6 +87,7 @@ extern "C" void LLVMInitializeARMTarget() {
   initializeGlobalISel(Registry);
   initializeARMLoadStoreOptPass(Registry);
   initializeARMPreAllocLoadStoreOptPass(Registry);
+  initializeARMConstantIslandsPass(Registry);
 }
 
 static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {