summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorJun Bum Lim <junbuml@codeaurora.org>2018-05-24 15:58:34 +0000
committerJun Bum Lim <junbuml@codeaurora.org>2018-05-24 15:58:34 +0000
commitdfbe6fa83249103e7836744f8764b81ff0543000 (patch)
tree3e0c4b3c862d4baebc2b5a5030a8adba1c072412 /llvm/lib/Transforms
parentd7af3e37117aad67310d50739d82d724339ec8d2 (diff)
downloadbcm5719-llvm-dfbe6fa83249103e7836744f8764b81ff0543000.tar.gz
bcm5719-llvm-dfbe6fa83249103e7836744f8764b81ff0543000.zip
[LICM] Preserve DT and LoopInfo specifically
Summary: In LICM, CFG could be changed in splitPredecessorsOfLoopExit(), which update only DT and LoopInfo. Therefore, we should preserve only DT and LoopInfo specifically, instead of all analyses that depend on the CFG (setPreservesCFG()). This change should fix PR37323. Reviewers: uabelho, davide, dberlin, Ka-Ka Reviewed By: dberlin Subscribers: mzolotukhin, bjope, mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D46775 llvm-svn: 333198
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 8c0747782d7..98599dea050 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -170,7 +170,8 @@ struct LegacyLICMPass : public LoopPass {
/// loop preheaders be inserted into the CFG...
///
void getAnalysisUsage(AnalysisUsage &AU) const override {
- AU.setPreservesCFG();
+ AU.addPreserved<DominatorTreeWrapperPass>();
+ AU.addPreserved<LoopInfoWrapperPass>();
AU.addRequired<TargetLibraryInfoWrapperPass>();
if (EnableMSSALoopDependency)
AU.addRequired<MemorySSAWrapperPass>();
@@ -220,7 +221,10 @@ PreservedAnalyses LICMPass::run(Loop &L, LoopAnalysisManager &AM,
return PreservedAnalyses::all();
auto PA = getLoopPassPreservedAnalyses();
- PA.preserveSet<CFGAnalyses>();
+
+ PA.preserve<DominatorTreeAnalysis>();
+ PA.preserve<LoopAnalysis>();
+
return PA;
}
OpenPOWER on IntegriCloud