2022-03-14 21:39:25 +08:00
; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
2016-04-10 17:50:10 +08:00
;
; TODO: FIXME: Investigate why we need a InvalidContext here.
;
; void f(int *A, int *B) {
; while (A != B) {
; *A = *A + 1;
; A++;
; }
; }
;
; CHECK: Invalid Context:
2018-02-20 15:26:42 +08:00
; CHECK-NEXT: [A, B] -> { : (4*floor((A - B)/4) < A - B) or ((-A + B) mod 4 = 0 and B >= 9223372036854775808 + A) or ((-A + B) mod 4 = 0 and B <= -4 + A) }
2016-04-10 17:50:10 +08:00
;
; CHECK: Domain :=
2018-02-20 15:26:42 +08:00
; CHECK-NEXT: [A, B] -> { Stmt_while_body[i0] : (-A + B) mod 4 = 0 and i0 >= 0 and 4i0 <= -4 - A + B };
2016-04-10 17:50:10 +08:00
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @f ( i32 * %A , i32 * %B ) {
entry:
br label %while.cond
while.cond: ; preds = %while.body, %entry
%A.addr.0 = phi i32 * [ %A , %entry ] , [ %incdec.ptr , %while.body ]
%cmp = icmp eq i32 * %A.addr.0 , %B
br i1 %cmp , label %while.end , label %while.body
while.body: ; preds = %while.cond
%tmp = load i32 , i32 * %A.addr.0 , align 4
%add = add nsw i32 %tmp , 1
store i32 %add , i32 * %A.addr.0 , align 4
%incdec.ptr = getelementptr inbounds i32 , i32 * %A.addr.0 , i64 1
br label %while.cond
while.end: ; preds = %while.cond
ret void
}