1 ; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-vector -dce -S %s | FileCheck %s
2 ; ModuleID = 'pr37143.s'
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
4 target triple = "x86_64-unknown-linux-gnu"
6 define void @_Z1fiPiPf(i32 %NumberOfSideSets, i32* %ssNumDFperSide, float* %ssDF) uwtable {
8 %tmp13 = sext i32 %NumberOfSideSets to i64
9 %tmp14 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %tmp13, i64 4)
10 %tmp15 = extractvalue { i64, i1 } %tmp14, 1
11 %tmp16 = extractvalue { i64, i1 } %tmp14, 0
12 %tmp17 = select i1 %tmp15, i64 -1, i64 %tmp16
13 %call = call noalias i8* @_Znam(i64 %tmp17)
14 %tmp5 = icmp sgt i32 %NumberOfSideSets, 0
15 %smax6 = select i1 %tmp5, i32 %NumberOfSideSets, i32 0
16 %tmp7 = zext i32 %smax6 to i64
19 for.cond: ; preds = %for.inc, %entry
20 %indvar3 = phi i64 [ %indvar.next4, %for.inc ], [ 0, %entry ]
21 %numNewDF.0 = phi i32 [ 0, %entry ], [ %add, %for.inc ]
22 %tmp10 = mul i64 %indvar3, 4
23 %scevgep = getelementptr i8* %call, i64 %tmp10
24 %arrayidx = bitcast i8* %scevgep to i32*
25 %exitcond8 = icmp ne i64 %indvar3, %tmp7
26 br i1 %exitcond8, label %for.body, label %for.end
28 for.body: ; preds = %for.cond
31 for.inc: ; preds = %for.body
32 %tmp9 = load i32* %arrayidx, align 4
33 %add = add nsw i32 %numNewDF.0, %tmp9
34 %indvar.next4 = add i64 %indvar3, 1
37 for.end: ; preds = %for.cond
38 %numNewDF.0.lcssa = phi i32 [ %numNewDF.0, %for.cond ]
39 %cmp13 = icmp sgt i32 %numNewDF.0.lcssa, 0
40 br i1 %cmp13, label %if.then, label %if.end
42 if.then: ; preds = %for.end
43 %tmp18 = sext i32 %numNewDF.0.lcssa to i64
44 %tmp19 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %tmp18, i64 4)
45 %tmp21 = extractvalue { i64, i1 } %tmp19, 1
46 %tmp22 = extractvalue { i64, i1 } %tmp19, 0
47 %tmp23 = select i1 %tmp21, i64 -1, i64 %tmp22
48 %call15 = call noalias i8* @_Znam(i64 %tmp23)
49 %tmp24 = bitcast i8* %call15 to float*
52 if.end: ; preds = %if.then, %for.end
53 %newssDF.0 = phi float* [ %tmp24, %if.then ], [ null, %for.end ]
54 %tmp20 = load i32* %ssNumDFperSide, align 4
55 %tmp = icmp sgt i32 %tmp20, 0
56 %smax = select i1 %tmp, i32 %tmp20, i32 0
57 %tmp1 = zext i32 %smax to i64
60 for.cond21: ; preds = %for.inc36, %if.end
61 %indvar = phi i64 [ %indvar.next, %for.inc36 ], [ 0, %if.end ]
62 %arrayidx29 = getelementptr float* %ssDF, i64 %indvar
63 %arrayidx35 = getelementptr float* %newssDF.0, i64 %indvar
64 %exitcond = icmp ne i64 %indvar, %tmp1
65 br i1 %exitcond, label %for.body25, label %for.end39
67 for.body25: ; preds = %for.cond21
68 %tmp30 = load float* %arrayidx29, align 4
69 store float %tmp30, float* %arrayidx35, align 4
72 for.inc36: ; preds = %for.body25
73 %indvar.next = add i64 %indvar, 1
76 for.end39: ; preds = %for.cond21
80 declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) nounwind readnone
82 declare noalias i8* @_Znam(i64)