From b0163b991be4e6a6edd660f31c86a4280224b9a2 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Wed, 12 Aug 2015 18:06:08 +0000 Subject: [PATCH] [PM/AA] Explicitly depend on TLI rather than getting it out of the AliasAnalysis. Same as the other commits, the TLI access from an alias analysis is going away and isn't very clean -- it is better to explicitly mark the dependencies. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244785 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Vectorize/BBVectorize.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Transforms/Vectorize/BBVectorize.cpp b/lib/Transforms/Vectorize/BBVectorize.cpp index ed134141e93..8b238caf8c8 100644 --- a/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/lib/Transforms/Vectorize/BBVectorize.cpp @@ -27,6 +27,7 @@ #include "llvm/Analysis/AliasSetTracker.h" #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionExpressions.h" +#include "llvm/Analysis/TargetLibraryInfo.h" #include "llvm/Analysis/TargetTransformInfo.h" #include "llvm/Analysis/ValueTracking.h" #include "llvm/IR/Constants.h" @@ -207,6 +208,7 @@ namespace { AA = &P->getAnalysis(); DT = &P->getAnalysis().getDomTree(); SE = &P->getAnalysis(); + TLI = &P->getAnalysis().getTLI(); TTI = IgnoreTargetInfo ? nullptr : &P->getAnalysis().getTTI(F); @@ -221,6 +223,7 @@ namespace { AliasAnalysis *AA; DominatorTree *DT; ScalarEvolution *SE; + const TargetLibraryInfo *TLI; const TargetTransformInfo *TTI; // FIXME: const correct? @@ -440,6 +443,7 @@ namespace { AA = &getAnalysis(); DT = &getAnalysis().getDomTree(); SE = &getAnalysis(); + TLI = &getAnalysis().getTLI(); TTI = IgnoreTargetInfo ? nullptr : &getAnalysis().getTTI( @@ -453,6 +457,7 @@ namespace { AU.addRequired(); AU.addRequired(); AU.addRequired(); + AU.addRequired(); AU.addRequired(); AU.addPreserved(); AU.addPreserved(); @@ -842,7 +847,7 @@ namespace { // It is important to cleanup here so that future iterations of this // function have less work to do. - (void)SimplifyInstructionsInBlock(&BB, AA->getTargetLibraryInfo()); + (void)SimplifyInstructionsInBlock(&BB, TLI); return true; } @@ -3192,6 +3197,7 @@ char BBVectorize::ID = 0; static const char bb_vectorize_name[] = "Basic-Block Vectorization"; INITIALIZE_PASS_BEGIN(BBVectorize, BBV_NAME, bb_vectorize_name, false, false) INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfoWrapperPass) INITIALIZE_PASS_DEPENDENCY(TargetTransformInfoWrapperPass) INITIALIZE_PASS_DEPENDENCY(DominatorTreeWrapperPass) INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) -- 2.34.1