From 7383bfd67e4d269f168723f27f8998768e6bbd1a Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 7 Jan 2013 10:22:36 +0000 Subject: Switch BBVectorize to directly depend on having a TTI analysis. This could be simplified further, but Hal has a specific feature for ignoring TTI, and so I preserved that. Also, I needed to use it because a number of tests fail when switching from a null TTI to the NoTTI nonce implementation. That seems suspicious to me and so may be something that you need to look into Hal. I worked it by preserving the old behavior for these tests with the flag that ignores all target info. llvm-svn: 171722 --- llvm/lib/Transforms/Vectorize/BBVectorize.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Transforms/Vectorize') diff --git a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp index c126c878925..d72a4a1a623 100644 --- a/llvm/lib/Transforms/Vectorize/BBVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/BBVectorize.cpp @@ -199,8 +199,7 @@ namespace { DT = &P->getAnalysis(); SE = &P->getAnalysis(); TD = P->getAnalysisIfAvailable(); - TTI = IgnoreTargetInfo ? 0 : - P->getAnalysisIfAvailable(); + TTI = IgnoreTargetInfo ? 0 : &P->getAnalysis(); } typedef std::pair ValuePair; @@ -424,8 +423,7 @@ namespace { DT = &getAnalysis(); SE = &getAnalysis(); TD = getAnalysisIfAvailable(); - TTI = IgnoreTargetInfo ? 0 : - getAnalysisIfAvailable(); + TTI = IgnoreTargetInfo ? 0 : &getAnalysis(); return vectorizeBB(BB); } @@ -435,6 +433,7 @@ namespace { AU.addRequired(); AU.addRequired(); AU.addRequired(); + AU.addRequired(); AU.addPreserved(); AU.addPreserved(); AU.addPreserved(); @@ -3022,6 +3021,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_AG_DEPENDENCY(TargetTransformInfo) INITIALIZE_PASS_DEPENDENCY(DominatorTree) INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_END(BBVectorize, BBV_NAME, bb_vectorize_name, false, false) -- cgit v1.2.3