Add pass-manager flags to use CFL AA
[oota-llvm.git] / lib / Transforms / IPO / PassManagerBuilder.cpp
index f5c5b065f11569d3e6e1585a58f6250a3d39bcc8..69189f389b7ed01818b17c766a2793001b959d40 100644 (file)
@@ -66,6 +66,9 @@ RunSLPAfterLoopVectorization("run-slp-after-loop-vectorization",
   cl::desc("Run the SLP vectorizer (and BB vectorizer) after the Loop "
            "vectorizer instead of before"));
 
+static cl::opt<bool> UseCFLAA("use-cfl-aa",
+  cl::init(false), cl::Hidden,
+  cl::desc("Enable the new, experimental CFL alias analysis"));
 
 PassManagerBuilder::PassManagerBuilder() {
     OptLevel = 2;
@@ -120,6 +123,8 @@ PassManagerBuilder::addInitialAliasAnalysisPasses(PassManagerBase &PM) const {
   // Add TypeBasedAliasAnalysis before BasicAliasAnalysis so that
   // BasicAliasAnalysis wins if they disagree. This is intended to help
   // support "obvious" type-punning idioms.
+  if (UseCFLAA)
+    PM.add(createCFLAliasAnalysisPass());
   PM.add(createTypeBasedAliasAnalysisPass());
   PM.add(createScopedNoAliasAAPass());
   PM.add(createBasicAliasAnalysisPass());