[polly] [polly] Add profitability check for expanded region. (PR #96548)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 29 06:28:33 PDT 2024


================
@@ -0,0 +1,56 @@
+; RUN: opt -polly-use-llvm-names -polly-region-expansion-profitability-check=1 \
+; RUN: -polly-loopfusion-greedy=1 "-passes=scop(polly-opt-isl,print<polly-ast>)" \
+; RUN: -disable-output < %s | FileCheck %s
+
+; void foo(int *restrict A, int *restrict B, int *restrict C, int n, int *restrict U) {
+;   for (int i = 0; i < 1024; ++i) // L1
+;     B[i] += A[i];
+;   for (int j = 0; j < 1024; ++j) // L2
+;     C[j] = B[j] + *U;
+; }
+
+define void @foo(ptr noalias nocapture noundef readonly %A, ptr noalias nocapture noundef %B, ptr noalias nocapture noundef writeonly %C, i32 noundef %n, ptr noalias nocapture noundef readonly %U) {
+entry:
+  br label %entry.split
+
+entry.split:                                      ; preds = %entry
+  br label %for.body
+
+for.cond3.preheader:                              ; preds = %for.body
+  %0 = load i32, ptr %U, align 4
+  br label %for.body6
----------------
Meinersbur wrote:

Could you sort the BBs to approximately match the execution order?

https://github.com/llvm/llvm-project/pull/96548


More information about the llvm-commits mailing list