llvm-project/polly/test/ScopInfo/non-affine-region-with-loop.ll
rahulana-quic e1f056f692
Reland "[polly] Port polly tests to use NPM" (#92918)
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.
2024-05-24 13:09:34 -07:00

42 lines
1.2 KiB
LLVM

; RUN: opt %loadNPMPolly -polly-allow-nonaffine-loops '-passes=print<polly-function-scops>' -disable-output < %s 2>&1 | FileCheck %s
; RUN: opt %loadNPMPolly -polly-allow-nonaffine-loops -passes=polly-codegen -disable-output
;
; CHECK: Domain :=
; CHECK-NEXT: { Stmt_loop2__TO__loop[] };
;
define void @foo(ptr %A, i64 %p) {
entry:
br label %loop
loop:
%indvar.3 = phi i64 [0, %entry], [%indvar.3, %loop], [%indvar.next.3, %next2], [%indvar.next.3, %cond]
%indvar = phi i64 [0, %entry], [%indvar.next, %loop], [0, %next2], [0, %cond]
%indvar.next = add i64 %indvar, 1
fence seq_cst
%cmp = icmp eq i64 %indvar, 100
br i1 %cmp, label %next, label %loop
next:
%indvar.next.3 = add i64 %indvar.3, 1
%cmp.3 = icmp eq i64 %indvar, 100
br i1 %cmp.3, label %loop2, label %exit
loop2:
%indvar.2 = phi i64 [0, %next], [%indvar.next.2, %loop2], [0, %cond]
%indvar.next.2 = add i64 %indvar.2, 1
%prod = mul i64 %indvar.2, %indvar.2
store i64 %indvar, ptr %A
%cmp.2 = icmp eq i64 %prod, 100
br i1 %cmp.2, label %loop2, label %next2
next2:
%cmp.4 = icmp eq i64 %p, 100
br i1 %cmp.4, label %loop, label %cond
cond:
br i1 false, label %loop, label %loop2
exit:
ret void
}