[polly] r284385 - [ScopDetect] Depend transitively on ScalarEvolution.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 06:29:20 PDT 2016


Author: meinersbur
Date: Mon Oct 17 08:29:20 2016
New Revision: 284385

URL: http://llvm.org/viewvc/llvm-project?rev=284385&view=rev
Log:
[ScopDetect] Depend transitively on ScalarEvolution.

ScopDetection might be queried by -dot-scops or -view-scops passes for which
it accesses ScalarEvolution.

Added:
    polly/trunk/test/ScopDetect/dot-scops.ll
Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=284385&r1=284384&r2=284385&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Oct 17 08:29:20 2016
@@ -1578,7 +1578,7 @@ void polly::ScopDetection::verifyAnalysi
 
 void ScopDetection::getAnalysisUsage(AnalysisUsage &AU) const {
   AU.addRequired<LoopInfoWrapperPass>();
-  AU.addRequired<ScalarEvolutionWrapperPass>();
+  AU.addRequiredTransitive<ScalarEvolutionWrapperPass>();
   AU.addRequired<DominatorTreeWrapperPass>();
   // We also need AA and RegionInfo when we are verifying analysis.
   AU.addRequiredTransitive<AAResultsWrapperPass>();

Added: polly/trunk/test/ScopDetect/dot-scops.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/dot-scops.ll?rev=284385&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/dot-scops.ll (added)
+++ polly/trunk/test/ScopDetect/dot-scops.ll Mon Oct 17 08:29:20 2016
@@ -0,0 +1,47 @@
+; RUN: opt %loadPolly -polly-scops -dot-scops -analyze < %s
+;
+; Check that the ScopPrinter does not crash.
+; ScopPrinter needs the ScopDetection pass, which should depend on
+; ScalarEvolution transitively.
+
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @func(i32 %n, i32 %m, double* noalias nonnull %A) {
+entry:
+  br label %outer.for
+
+outer.for:
+  %j = phi i32 [0, %entry], [%j.inc, %outer.inc]
+  %j.cmp = icmp slt i32 %j, %n
+  br i1 %j.cmp, label %inner.for, label %outer.exit
+
+  inner.for:
+    %i = phi i32 [1, %outer.for], [%i.inc, %inner.inc]
+    %b = phi double [0.0, %outer.for], [%a, %inner.inc]
+    %i.cmp = icmp slt i32 %i, %m
+    br i1 %i.cmp, label %body1, label %inner.exit
+
+    body1:
+      %A_idx = getelementptr inbounds double, double* %A, i32 %i
+      %a = load double, double* %A_idx
+      store double %a, double* %A_idx
+      br label %inner.inc
+
+  inner.inc:
+    %i.inc = add nuw nsw i32 %i, 1
+    br label %inner.for
+
+  inner.exit:
+    br label %outer.inc
+
+outer.inc:
+  store double %b, double* %A
+  %j.inc = add nuw nsw i32 %j, 1
+  br label %outer.for
+
+outer.exit:
+  br label %return
+
+return:
+  ret void
+}




More information about the llvm-commits mailing list