[llvm] 7bdc83f - [LICM] Don't cache AliasSetTrackers when run under legacy PM

Daniil Suchkov via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 22:18:44 PST 2020


Author: Daniil Suchkov
Date: 2020-01-22T13:16:45+07:00
New Revision: 7bdc83f34016bb0288f7af6fffa244bfeb285d04

URL: https://github.com/llvm/llvm-project/commit/7bdc83f34016bb0288f7af6fffa244bfeb285d04
DIFF: https://github.com/llvm/llvm-project/commit/7bdc83f34016bb0288f7af6fffa244bfeb285d04.diff

LOG: [LICM] Don't cache AliasSetTrackers when run under legacy PM

Summary:
This is the first step towards complete removal of AST caching from
LICM. Attempts to keep LICM's AST cache up to date across passes can lead
to miscompiles like this one: https://bugs.llvm.org/show_bug.cgi?id=44320.

LICM has already switched to using MemorySSA to do sinking and hoisting
and only builds an AliasSetTracker on demand for the promoteToScalars
step, without caching it from one LICM instance to the next. Given this,
we don't have compile-time reasons to keep AST caching any more.
The only scenario where the caching would be used currently is when
using the LegacyPassManager and setting -enable-mssa-loop-dependency=false.

This switch should help us to surface any possible issues that may arise
along this way, also it turns subsequent removal of AST caching into NFC.

Reviewers: asbirlea, fhahn, efriedma, reames

Reviewed By: asbirlea

Subscribers: hiraditya, george.burgess.iv, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73081

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/LICM.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 8c33045c2380..ad1fb6c66f44 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -226,7 +226,7 @@ struct LegacyLICMPass : public LoopPass {
                               *L->getHeader()->getParent()),
                           &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(
                               *L->getHeader()->getParent()),
-                          SE ? &SE->getSE() : nullptr, MSSA, &ORE, false);
+                          SE ? &SE->getSE() : nullptr, MSSA, &ORE, true);
   }
 
   /// This transformation requires natural loop information & requires that


        


More information about the llvm-commits mailing list