1 ; RUN: opt %loadPolly -basic-aa -polly-print-dependences -disable-output < %s | FileCheck %s
3 ; Verify we do not have dependences between the if and the else clause
5 ; CHECK: RAW dependences:
7 ; CHECK-NEXT: WAR dependences:
9 ; CHECK-NEXT: WAW dependences:
11 ; CHECK-NEXT: Reduction dependences:
12 ; CHECK-NEXT: { Stmt_if_else[i0] -> Stmt_if_else[1 + i0] : 512 <= i0 <= 1022; Stmt_if_then[i0] -> Stmt_if_then[1 + i0] : 0 <= i0 <= 510 }
14 ; void f(int *restrict sum, int *restrict prod) {
15 ; for (int i = 0; i < 1024; i++)
22 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
24 define void @f(ptr noalias %sum, ptr noalias %prod) {
28 for.cond: ; preds = %for.inc, %entry
29 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
30 %exitcond = icmp ne i32 %i.0, 1024
31 br i1 %exitcond, label %for.body, label %for.end
33 for.body: ; preds = %for.cond
34 %cmp1 = icmp slt i32 %i.0, 512
35 br i1 %cmp1, label %if.then, label %if.else
37 if.then: ; preds = %for.body
38 %tmp = load i32, ptr %sum, align 4
39 %add = add nsw i32 %tmp, %i.0
40 store i32 %add, ptr %sum, align 4
43 if.else: ; preds = %for.body
44 %tmp1 = load i32, ptr %prod, align 4
45 %mul = mul nsw i32 %tmp1, %i.0
46 store i32 %mul, ptr %prod, align 4
49 if.end: ; preds = %if.else, %if.then
52 for.inc: ; preds = %if.end
53 %inc = add nsw i32 %i.0, 1
56 for.end: ; preds = %for.cond