brintos

brintos / llvm-project-archived public Read only

0
0
Text · 773 B · 1988f77 Raw
32 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly<no-default-opts>' -S < %s | FileCheck %s2 3; This test ensures that the expression N + 1 that is stored in the phi-node4; alloca, is directly computed and not incorrectly transferred through memory.5 6; CHECK: store i64 [[REG:%.*]], ptr %res.phiops7; CHECK: [[REG]] = add i64 %N, 18 9define i64 @foo(ptr %A, i64 %N) {10entry:11  br label %next12 13next:14  %cond = icmp eq i64 %N, 015  br i1 %cond, label %loop, label %merge16 17loop:18  %indvar = phi i64 [0, %next], [%indvar.next, %loop]19  %indvar.next = add i64 %indvar, 120  %sum = add i64 %N, 121  store float 4.0, ptr %A22  %cmp = icmp sle i64 %indvar.next, 10023  br i1 %cmp, label %loop, label %merge24 25merge:26  %res = phi i64 [%sum, %loop], [0, %next]27  br label %exit28 29exit:30  ret i64 %res31}32