59 lines · plain
1; RUN: opt %loadNPMPolly -aa-pipeline=basic-aa '-passes=polly-custom<deps>' -polly-print-deps -disable-output < %s | FileCheck %s2;3; Verify we do not have dependences between the if and the else clause4;5; CHECK: RAW dependences:6; CHECK-NEXT: { }7; CHECK-NEXT: WAR dependences:8; CHECK-NEXT: { }9; CHECK-NEXT: WAW dependences:10; CHECK-NEXT: { }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 }13;14; void f(int *restrict sum, int *restrict prod) {15; for (int i = 0; i < 1024; i++)16; if (i < 512)17; *sum += i;18; else19; *prod *= i;20; }21;22target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"23 24define void @f(ptr noalias %sum, ptr noalias %prod) {25entry:26 br label %for.cond27 28for.cond: ; preds = %for.inc, %entry29 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]30 %exitcond = icmp ne i32 %i.0, 102431 br i1 %exitcond, label %for.body, label %for.end32 33for.body: ; preds = %for.cond34 %cmp1 = icmp slt i32 %i.0, 51235 br i1 %cmp1, label %if.then, label %if.else36 37if.then: ; preds = %for.body38 %tmp = load i32, ptr %sum, align 439 %add = add nsw i32 %tmp, %i.040 store i32 %add, ptr %sum, align 441 br label %if.end42 43if.else: ; preds = %for.body44 %tmp1 = load i32, ptr %prod, align 445 %mul = mul nsw i32 %tmp1, %i.046 store i32 %mul, ptr %prod, align 447 br label %if.end48 49if.end: ; preds = %if.else, %if.then50 br label %for.inc51 52for.inc: ; preds = %if.end53 %inc = add nsw i32 %i.0, 154 br label %for.cond55 56for.end: ; preds = %for.cond57 ret void58}59