[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.

llvm-svn: 244880
This commit is contained in:
Chandler Carruth 2015-08-13 10:00:53 +00:00
parent 8ae7b81559
commit c2af09823f
1 changed files with 5 additions and 3 deletions

View File

@ -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<AliasAnalysis>();
DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree();
LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
SE = &getAnalysis<ScalarEvolution>();
@ -505,7 +507,7 @@ bool LoopIdiomRecognize::processLoopStridedStore(
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::processLoopStoreOfLoopLoad(
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::processLoopStoreOfLoopLoad(
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);