[polly] d50f92a - [Polly] Added dedicated test for working -O3 pipeline.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 10 11:26:38 PST 2021


Author: Michael Kruse
Date: 2021-02-10T13:25:56-06:00
New Revision: d50f92a4f0bcd2a28ac0e4ad9942998b144cf48d

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

LOG: [Polly] Added dedicated test for working -O3 pipeline.

Test the NewPM as well as the legacy PM.

Added: 
    polly/test/Support/passmanager-O3.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/polly/test/Support/passmanager-O3.ll b/polly/test/Support/passmanager-O3.ll
new file mode 100644
index 000000000000..aaa90b78fcd7
--- /dev/null
+++ b/polly/test/Support/passmanager-O3.ll
@@ -0,0 +1,41 @@
+; RUN: opt %loadPolly -enable-new-pm=0 -polly -O3 -S < %s | FileCheck %s
+; RUN: opt %loadPolly -enable-new-pm=1 -polly -O3 -S < %s | FileCheck %s
+;
+; Check that Polly's default pipeline works from detection to code generation
+; with either pass manager.
+; The presence of the BB polly.stmt.body.lr.ph indicates that the statement
+; has been re-generated by Polly. It should not have been merged with other
+; BBs by SimplifyCFG.
+;
+; for (int j = 0; j < n; j += 1) {
+;   A[0] = 42.0;
+; }
+;
+define void @func(i32 %n, double* noalias nonnull %A) {
+entry:
+  br label %for
+
+for:
+  %j = phi i32 [0, %entry], [%j.inc, %inc]
+  %j.cmp = icmp slt i32 %j, %n
+  br i1 %j.cmp, label %body, label %exit
+
+    body:
+      store double 42.0, double* %A
+      br label %inc
+
+inc:
+  %j.inc = add nuw nsw i32 %j, 1
+  br label %for
+
+exit:
+  br label %return
+
+return:
+  ret void
+}
+
+
+; CHECK-LABEL: define void @func(i32 %n, double* noalias nocapture nonnull %A)
+; CHECK:       polly.stmt.body.lr.ph:
+; CHECK-NEXT:    store double 4.200000e+01, double* %A, align 8


        


More information about the llvm-commits mailing list