From: Chandler Carruth Date: Thu, 13 Aug 2015 10:00:53 +0000 (+0000) Subject: [LIR] Handle access to AliasAnalysis the same way as the other analysis X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=commitdiff_plain;h=8d26d44905de0eb2b521601c83b6e540a156d94d [LIR] Handle access to AliasAnalysis the same way as the other analysis in LoopIdiomRecognize. This is what started me staring at this code. Now migrating it with the new AA stuff will be trivial. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244880 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp index f2f37eec53b..0a4a7bb51e0 100644 --- a/lib/Transforms/Scalar/LoopIdiomRecognize.cpp +++ b/lib/Transforms/Scalar/LoopIdiomRecognize.cpp @@ -69,6 +69,7 @@ namespace { class LoopIdiomRecognize : public LoopPass { Loop *CurLoop; + AliasAnalysis *AA; DominatorTree *DT; LoopInfo *LI; ScalarEvolution *SE; @@ -188,6 +189,7 @@ bool LoopIdiomRecognize::runOnLoop(Loop *L, LPPassManager &LPM) { if (Name == "memset" || Name == "memcpy") return false; + AA = &getAnalysis(); DT = &getAnalysis().getDomTree(); LI = &getAnalysis().getLoopInfo(); SE = &getAnalysis(); @@ -505,7 +507,7 @@ bool LoopIdiomRecognize::processLoopStridedStore( Preheader->getTerminator()); if (mayLoopAccessLocation(BasePtr, MRI_ModRef, CurLoop, BECount, StoreSize, - getAnalysis(), TheStore)) { + *AA, TheStore)) { Expander.clear(); // If we generated new code for the base pointer, clean up. RecursivelyDeleteTriviallyDeadInstructions(BasePtr, TLI); @@ -594,7 +596,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad( Preheader->getTerminator()); if (mayLoopAccessLocation(StoreBasePtr, MRI_ModRef, CurLoop, BECount, - StoreSize, getAnalysis(), SI)) { + StoreSize, *AA, SI)) { Expander.clear(); // If we generated new code for the base pointer, clean up. RecursivelyDeleteTriviallyDeadInstructions(StoreBasePtr, TLI); @@ -608,7 +610,7 @@ bool LoopIdiomRecognize::processLoopStoreOfLoopLoad( Preheader->getTerminator()); if (mayLoopAccessLocation(LoadBasePtr, MRI_Mod, CurLoop, BECount, StoreSize, - getAnalysis(), SI)) { + *AA, SI)) { Expander.clear(); // If we generated new code for the base pointer, clean up. RecursivelyDeleteTriviallyDeadInstructions(LoadBasePtr, TLI);