mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-23 23:06:06 +00:00

Even as the NPM has been in use by Polly for a while now, the majority of the tests continue using the LPM passes. This patch ports the tests to use the NPM passes (for example, by replacing a flag such as -polly-detect with -passes=polly-detect following the NPM syntax for specifying passes) with some exceptions for some missing features in the new passes. Relanding #90632.
51 lines
1.5 KiB
LLVM
51 lines
1.5 KiB
LLVM
; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=print<polly-detect>' -disable-output < %s 2>&1 | FileCheck %s -check-prefix=PHI
|
|
|
|
; void f(long A[], long N, long *init_ptr) {
|
|
; long i, j;
|
|
; long i_non_canonical;
|
|
;
|
|
; for (i = 0; i < N; ++i) {
|
|
; init = *init_ptr;
|
|
; i_non_canonical = init;
|
|
; for (i = 0; i < N; ++i) {
|
|
; A[i] = i_non_canonical;
|
|
; i_non_canonical += 1;
|
|
; }
|
|
; }
|
|
; }
|
|
|
|
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
|
|
|
|
define void @f(ptr noalias %A, i64 %N, ptr noalias %init_ptr) nounwind {
|
|
entry:
|
|
br label %for.i
|
|
|
|
for.i:
|
|
%indvar.i = phi i64 [ 0, %entry ], [ %indvar.i.next, %for.i.end ]
|
|
%indvar.i.next = add nsw i64 %indvar.i, 1
|
|
br label %entry.next
|
|
|
|
entry.next:
|
|
%init = load i64, ptr %init_ptr
|
|
br label %for.j
|
|
|
|
for.j:
|
|
%indvar.j = phi i64 [ 0, %entry.next ], [ %indvar.j.next, %for.j ]
|
|
%indvar.j.non_canonical = phi i64 [ %init, %entry.next ], [ %indvar.j.non_canonical.next, %for.j ]
|
|
%scevgep = getelementptr i64, ptr %A, i64 %indvar.j
|
|
store i64 %indvar.j.non_canonical, ptr %scevgep
|
|
%indvar.j.next = add nsw i64 %indvar.j, 1
|
|
%indvar.j.non_canonical.next = add nsw i64 %indvar.j.non_canonical, 1
|
|
%exitcond.j = icmp eq i64 %indvar.j.next, %N
|
|
br i1 %exitcond.j, label %for.i.end, label %for.j
|
|
|
|
for.i.end:
|
|
%exitcond.i = icmp eq i64 %indvar.i.next, %N
|
|
br i1 %exitcond.i, label %return, label %for.i
|
|
|
|
return:
|
|
ret void
|
|
}
|
|
|
|
; PHI: Valid Region for Scop: for.i => return
|