[PATCH] D30726: Do not cache AliasSetTracker even in the old PM

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 7 16:36:19 PST 2017


sanjoy created this revision.
Herald added a subscriber: mcrosier.

Fixes PR32129.  Test case contributed by Igor Laevsky.

I can't easily think of other ways to safely cache the ASTs.  Given
we're going to move to recomputing them in the new PM anyway (unless
there are future plans to not to?), I think it is uncontroversial to
bring the old PM in sync.

If this change is accepted, I'll also delete the code that keeps track
of the Loop->AST mapping.  But first I want to know if this change is
acceptable or not.


https://reviews.llvm.org/D30726

Files:
  lib/Transforms/Scalar/LICM.cpp
  test/Transforms/LICM/pr32129.ll


Index: test/Transforms/LICM/pr32129.ll
===================================================================
--- /dev/null
+++ test/Transforms/LICM/pr32129.ll
@@ -0,0 +1,18 @@
+; RUN: opt -S -licm -loop-unswitch -licm < %s | FileCheck %s
+
+declare void @llvm.experimental.guard(i1, ...)
+
+define void @test() {
+; CHECK-LABEL: @test(
+; CHECK-NOT: guard
+entry:
+  br label %header
+
+header:
+  br label %loop
+
+loop:
+  %0 = icmp ult i32 0, 400
+  call void (i1, ...) @llvm.experimental.guard(i1 %0, i32 9) [ "deopt"() ]
+  br i1 undef, label %header, label %loop
+}
Index: lib/Transforms/Scalar/LICM.cpp
===================================================================
--- lib/Transforms/Scalar/LICM.cpp
+++ lib/Transforms/Scalar/LICM.cpp
@@ -155,7 +155,7 @@
                           &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(),
                           &getAnalysis<DominatorTreeWrapperPass>().getDomTree(),
                           &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(),
-                          SE ? &SE->getSE() : nullptr, &ORE, false);
+                          SE ? &SE->getSE() : nullptr, &ORE, true);
   }
 
   /// This transformation requires natural loop information & requires that


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30726.90962.patch
Type: text/x-patch
Size: 1231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170308/be3bbd7e/attachment.bin>


More information about the llvm-commits mailing list