From: Chandler Carruth Date: Mon, 7 Jan 2013 09:17:41 +0000 (+0000) Subject: Switch LoopIdiom pass to directly require target transform information. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;ds=sidebyside;h=d12aae6c0535bd2713207ef84b7098f905a89b78;p=oota-llvm.git Switch LoopIdiom pass to directly require target transform information. I'm sorry for duplicating bad style here, but I wanted to keep consistency. I've pinged the code review thread where this style was reviewed and changes were requested. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171714 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index 59109a78656..c4f90125ac5 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -177,6 +177,7 @@ namespace { AU.addPreserved(); AU.addRequired(); AU.addRequired(); + AU.addRequired(); } const DataLayout *getDataLayout() { @@ -196,9 +197,7 @@ namespace { } const TargetTransformInfo *getTargetTransformInfo() { - if (!TTI) - TTI = getAnalysisIfAvailable(); - return TTI; + return TTI ? TTI : (TTI = &getAnalysis()); } Loop *getLoop() const { return CurLoop; } @@ -219,6 +218,7 @@ INITIALIZE_PASS_DEPENDENCY(LCSSA) INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) INITIALIZE_PASS_DEPENDENCY(TargetLibraryInfo) INITIALIZE_AG_DEPENDENCY(AliasAnalysis) +INITIALIZE_AG_DEPENDENCY(TargetTransformInfo) INITIALIZE_PASS_END(LoopIdiomRecognize, "loop-idiom", "Recognize loop idioms", false, false)