1 ; RUN: opt %loadNPMPolly '-passes=print<polly-function-scops>,scop(print<polly-simplify>)' -disable-output < %s | FileCheck %s
3 ; The use of %sum.next by %phi counts as an escaping use.
4 ; Don't remove the scalar write of %sum.next.
6 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
8 define float @foo(ptr %A) {
14 br i1 true, label %body, label %exit
17 %i = phi i64 [ 0, %header ], [ %next, %body ]
18 %sum = phi float [ 0.0, %header ], [ %sum.next, %body ]
19 %arrayidx = getelementptr float, ptr %A, i64 %i
20 %next = add nuw nsw i64 %i, 1
21 %val = load float, ptr %arrayidx
22 %sum.next = fadd float %sum, %val
23 %cond = icmp ne i64 %i, 100
24 br i1 %cond, label %body, label %after
30 %phi = phi float [%sum.next, %after], [0.0, %header]
36 ; CHECK: Dead accesses removed: 0