[cfe-commits] r171683 - /cfe/trunk/lib/CodeGen/BackendUtil.cpp

Chandler Carruth chandlerc at gmail.com
Sun Jan 6 17:38:01 PST 2013


Author: chandlerc
Date: Sun Jan  6 19:38:01 2013
New Revision: 171683

URL: http://llvm.org/viewvc/llvm-project?rev=171683&view=rev
Log:
Switch to asking the target machine to add any relevant analysis passses
rather than doing it ourselves. This reflects the API changes in r171681.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=171683&r1=171682&r2=171683&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Sun Jan  6 19:38:01 2013
@@ -31,7 +31,6 @@
 #include "llvm/Target/TargetLibraryInfo.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
-#include "llvm/TargetTransformInfo.h"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/Transforms/IPO/PassManagerBuilder.h"
 #include "llvm/Transforms/Instrumentation.h"
@@ -59,11 +58,8 @@
     if (!CodeGenPasses) {
       CodeGenPasses = new PassManager();
       CodeGenPasses->add(new DataLayout(TheModule));
-      // Add TargetTransformInfo.
-      if (TM) {
-        CodeGenPasses->add(createNoTTIPass(TM->getScalarTargetTransformInfo(),
-                                           TM->getVectorTargetTransformInfo()));
-      }
+      if (TM)
+        TM->addAnalysisPasses(*CodeGenPasses);
     }
     return CodeGenPasses;
   }
@@ -72,11 +68,8 @@
     if (!PerModulePasses) {
       PerModulePasses = new PassManager();
       PerModulePasses->add(new DataLayout(TheModule));
-      if (TM) {
-        PerModulePasses->add(
-            createNoTTIPass(TM->getScalarTargetTransformInfo(),
-                            TM->getVectorTargetTransformInfo()));
-      }
+      if (TM)
+        TM->addAnalysisPasses(*PerModulePasses);
     }
     return PerModulePasses;
   }
@@ -85,11 +78,8 @@
     if (!PerFunctionPasses) {
       PerFunctionPasses = new FunctionPassManager(TheModule);
       PerFunctionPasses->add(new DataLayout(TheModule));
-      if (TM) {
-        PerFunctionPasses->add(
-            createNoTTIPass(TM->getScalarTargetTransformInfo(),
-                            TM->getVectorTargetTransformInfo()));
-      }
+      if (TM)
+        TM->addAnalysisPasses(*PerFunctionPasses);
     }
     return PerFunctionPasses;
   }
@@ -477,9 +467,8 @@
     TLI->disableAllFunctions();
   PM->add(TLI);
 
-  // Add TargetTransformInfo.
-  PM->add(createNoTTIPass(TM->getScalarTargetTransformInfo(),
-                          TM->getVectorTargetTransformInfo()));
+  // Add Target specific analysis passes.
+  TM->addAnalysisPasses(*PM);
 
   // Normal mode, emit a .s or .o file by running the code generator. Note,
   // this also adds codegenerator level optimization passes.





More information about the cfe-commits mailing list