[llvm] r244880 - [LIR] Handle access to AliasAnalysis the same way as the other analysis

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 13 03:00:53 PDT 2015


Author: chandlerc
Date: Thu Aug 13 05:00:53 2015
New Revision: 244880

URL: http://llvm.org/viewvc/llvm-project?rev=244880&view=rev
Log:
[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.

Modified:
    llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp?rev=244880&r1=244879&r2=244880&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopIdiomRecognize.cpp Thu Aug 13 05:00:53 2015
@@ -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
   if (Name == "memset" || Name == "memcpy")
     return false;
 
+  AA = &getAnalysis<AliasAnalysis>();
   DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
   LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
   SE = &getAnalysis<ScalarEvolution>();
@@ -505,7 +507,7 @@ bool LoopIdiomRecognize::processLoopStri
                                           Preheader->getTerminator());
 
   if (mayLoopAccessLocation(BasePtr, MRI_ModRef, CurLoop, BECount, StoreSize,
-                            getAnalysis<AliasAnalysis>(), 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::processLoopStor
       Preheader->getTerminator());
 
   if (mayLoopAccessLocation(StoreBasePtr, MRI_ModRef, CurLoop, BECount,
-                            StoreSize, getAnalysis<AliasAnalysis>(), 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::processLoopStor
       Preheader->getTerminator());
 
   if (mayLoopAccessLocation(LoadBasePtr, MRI_Mod, CurLoop, BECount, StoreSize,
-                            getAnalysis<AliasAnalysis>(), SI)) {
+                            *AA, SI)) {
     Expander.clear();
     // If we generated new code for the base pointer, clean up.
     RecursivelyDeleteTriviallyDeadInstructions(LoadBasePtr, TLI);




More information about the llvm-commits mailing list