1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; CHECK: Function: f_no_fast_math
4 ; CHECK: Reduction Type: NONE
5 ; CHECK: Function: f_fast_math
6 ; CHECK: Reduction Type: +
9 ; for (int i = 0; i < 100; i++)
12 target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-n32-S64"
14 define void @f_no_fast_math(ptr %sum) {
18 for.cond: ; preds = %for.inc, %entry
19 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
20 %exitcond = icmp ne i32 %i.0, 100
21 br i1 %exitcond, label %for.body, label %for.end
23 for.body: ; preds = %for.cond
24 %conv = sitofp i32 %i.0 to float
25 %pi = fptrunc double 3.41 to float
26 %mul = fmul float %conv, %pi
27 %tmp = load float, ptr %sum, align 4
28 %add = fadd float %tmp, %mul
29 store float %add, ptr %sum, align 4
32 for.inc: ; preds = %for.body
33 %inc = add nsw i32 %i.0, 1
36 for.end: ; preds = %for.cond
40 define void @f_fast_math(ptr %sum) {
44 for.cond: ; preds = %for.inc, %entry
45 %i.0 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
46 %exitcond = icmp ne i32 %i.0, 100
47 br i1 %exitcond, label %for.body, label %for.end
49 for.body: ; preds = %for.cond
50 %conv = sitofp i32 %i.0 to float
51 %pi = fptrunc double 3.41 to float
52 %mul = fmul fast float %conv, %pi
53 %tmp = load float, ptr %sum, align 4
54 %add = fadd fast float %tmp, %mul
55 store float %add, ptr %sum, align 4
58 for.inc: ; preds = %for.body
59 %inc = add nsw i32 %i.0, 1
62 for.end: ; preds = %for.cond