llvm/polly/test/ScopDetect/non_affine_loop_condition.ll
Michael Kruse 5c02808131 [polly] Introduce -polly-print-* passes to replace -analyze.
The `opt -analyze` option only works with the legacy pass manager and might be removed in the future, as explained in llvm.org/PR53733. This patch introduced -polly-print-* passes that print what the pass would print with the `-analyze` option and replaces all uses of `-analyze` in the regression tests.

There are two exceptions: `CodeGen\single_loop_param_less_equal.ll` and `CodeGen\loop_with_condition_nested.ll` use `-analyze on the `-loops` pass which is not part of Polly.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D120782
2022-03-14 10:27:15 -05:00

51 lines
1.7 KiB
LLVM

; RUN: opt %loadPolly -polly-allow-nonaffine-loops -polly-print-detect -disable-output < %s | FileCheck %s
; RUN: opt %loadPolly -polly-allow-nonaffine-loops -polly-process-unprofitable=false -polly-print-detect -disable-output < %s | FileCheck %s --check-prefix=PROFIT
;
; void f(int *A) {
; for (int i = 0; i < 1024; i++) {
; while (A[i])
; A[i]--;
; }
; }
;
; PROFIT-NOT: Valid
;
; CHECK: Valid Region for Scop: bb1 => bb12
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f(i32* %A) {
bb:
br label %bb1
bb1: ; preds = %bb11, %bb
%indvars.iv = phi i64 [ %indvars.iv.next, %bb11 ], [ 0, %bb ]
%exitcond = icmp ne i64 %indvars.iv, 1024
br i1 %exitcond, label %bb2, label %bb12
bb2: ; preds = %bb1
br label %bb3
bb3: ; preds = %bb6, %bb2
%tmp = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp4 = load i32, i32* %tmp, align 4
%tmp5 = icmp eq i32 %tmp4, 0
br i1 %tmp5, label %bb10, label %bb6
bb6: ; preds = %bb3
%tmp7 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp8 = load i32, i32* %tmp7, align 4
%tmp9 = add nsw i32 %tmp8, -1
store i32 %tmp9, i32* %tmp7, align 4
br label %bb3
bb10: ; preds = %bb3
br label %bb11
bb11: ; preds = %bb10
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
br label %bb1
bb12: ; preds = %bb1
ret void
}