[llvm] r244041 - [AArch64] Register (existing) AArch64LoadStoreOpt pass with LLVM pass manager.

Chad Rosier mcrosier at codeaurora.org
Wed Aug 5 06:44:51 PDT 2015


Author: mcrosier
Date: Wed Aug  5 08:44:51 2015
New Revision: 244041

URL: http://llvm.org/viewvc/llvm-project?rev=244041&view=rev
Log:
[AArch64] Register (existing) AArch64LoadStoreOpt pass with LLVM pass manager.

Summary: Among other things, this allows -print-after-all/-print-before-all to
dump IR around this pass.

This is the AArch64 version of r243052.

Modified:
    llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp

Modified: llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp?rev=244041&r1=244040&r2=244041&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64LoadStoreOptimizer.cpp Wed Aug  5 08:44:51 2015
@@ -50,6 +50,12 @@ static cl::opt<bool> EnableAArch64Unscal
     "aarch64-unscaled-mem-op", cl::Hidden,
     cl::desc("Allow AArch64 unscaled load/store combining"), cl::init(true));
 
+namespace llvm {
+void initializeAArch64LoadStoreOptPass(PassRegistry &);
+}
+
+#define AARCH64_LOAD_STORE_OPT_NAME "AArch64 load / store optimization pass"
+
 namespace {
 
 typedef struct LdStPairFlags {
@@ -76,7 +82,9 @@ typedef struct LdStPairFlags {
 
 struct AArch64LoadStoreOpt : public MachineFunctionPass {
   static char ID;
-  AArch64LoadStoreOpt() : MachineFunctionPass(ID) {}
+  AArch64LoadStoreOpt() : MachineFunctionPass(ID) {
+    initializeAArch64LoadStoreOptPass(*PassRegistry::getPassRegistry());
+  }
 
   const AArch64InstrInfo *TII;
   const TargetRegisterInfo *TRI;
@@ -124,7 +132,7 @@ struct AArch64LoadStoreOpt : public Mach
   bool runOnMachineFunction(MachineFunction &Fn) override;
 
   const char *getPassName() const override {
-    return "AArch64 load / store optimization pass";
+    return AARCH64_LOAD_STORE_OPT_NAME;
   }
 
 private:
@@ -133,6 +141,9 @@ private:
 char AArch64LoadStoreOpt::ID = 0;
 } // namespace
 
+INITIALIZE_PASS(AArch64LoadStoreOpt, "aarch64-ldst-opt",
+                AARCH64_LOAD_STORE_OPT_NAME, false, false)
+
 static bool isUnscaledLdst(unsigned Opc) {
   switch (Opc) {
   default:




More information about the llvm-commits mailing list