brintos

brintos / llvm-project-archived public Read only

0
0
Text · 938 B · d56fed4 Raw
38 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<simplify>' -polly-print-scops -polly-print-simplify -disable-output < %s | FileCheck %s2;3; The use of %sum.next by %phi counts as an escaping use.4; Don't remove the scalar write of %sum.next.5;6target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"7 8define float @foo(ptr %A) {9entry:10  br label %header11 12header:13  fence seq_cst14  br i1 true, label %body, label %exit15 16body: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 %i20  %next = add nuw nsw i64 %i, 121  %val = load float, ptr %arrayidx22  %sum.next = fadd float %sum, %val23  %cond = icmp ne i64 %i, 10024  br i1 %cond, label %body, label %after25 26after:27  br label %exit28 29exit:30  %phi = phi float [%sum.next, %after], [0.0, %header]31  ret float %phi32}33 34 35; CHECK: Statistics {36; CHECK:     Dead accesses removed: 037; CHECK: }38