summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-08-14 00:21:10 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-08-14 00:21:10 +0000
commitbf143e2a202010bfbb03d6630235d46e1c57808f (patch)
treed353ee655a04cfdd6f0efb348917d7d6c2256946 /llvm/lib/Transforms
parent5da0dde965f7633bc81699a5a45b634146882bc6 (diff)
downloadbcm5719-llvm-bf143e2a202010bfbb03d6630235d46e1c57808f.tar.gz
bcm5719-llvm-bf143e2a202010bfbb03d6630235d46e1c57808f.zip
[LIR] Re-instate r244880, reverted in r244884, factoring the handling of
AliasAnalysis in LoopIdiomRecognize. The previous commit to LIR, r244879, exposed some scary bug in the loop pass pipeline with an assert failure that showed up on several bots. This patch got reverted as part of getting that revision reverted, but they're actually independent and unrelated. This patch has no functional change and should be completely safe. It is also useful for my current work on the AA infrastructure. llvm-svn: 244993
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp b/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
index e3fe2530c2b..ee520310520 100644
--- a/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
+++ b/llvm/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<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);
OpenPOWER on IntegriCloud