[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:34 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;
----------------
Meinersbur wrote:

```suggestion
;     int u = *U; // LICM
;   for (int j = 0; j < 1024; ++j) // L2
;     C[j] = B[j] + u;
```
So the pseudocode is relevant to what we are testing.

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


More information about the llvm-commits mailing list