1 ; RUN: opt %loadPolly -polly-detect-unprofitable -S -polly-code-generator=isl -polly-codegen-isl < %s | FileCheck %s
3 ; Check that we do not crash as described here: http://llvm.org/PR21167
5 ; In case the pieceweise affine function used to create an isl_ast_expr
6 ; had empty cases (e.g., with contradicting constraints on the
7 ; parameters), it was possible that the condition of the isl_ast_expr
8 ; select was not a comparison but a constant (thus of type i64).
9 ; However, we shouldn't crash in such a case :)
11 ; CHECK: polly.split_new_and_old
13 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
15 ; Function Attrs: nounwind uwtable
16 define void @dradb4(i32 %ido, i32 %l1, float* %cc, float* %ch, float* %wa1, float* %wa3) #0 {
18 %mul = mul nsw i32 %l1, %ido
19 br i1 undef, label %for.end256, label %if.end
21 if.end: ; preds = %entry
22 br i1 undef, label %L105, label %for.cond45.preheader
24 for.cond45.preheader: ; preds = %if.end
25 br i1 undef, label %for.body47, label %for.end198
27 for.body47: ; preds = %for.inc096, %for.cond45.preheader
28 br i1 undef, label %for.body53.lr.ph, label %for.inc096
30 for.body53.lr.ph: ; preds = %for.body47
33 for.body53: ; preds = %for.body53, %for.body53.lr.ph
34 %t7.014 = phi i32 [ 0, %for.body53.lr.ph ], [ %add58, %for.body53 ]
35 %i.013 = phi i32 [ 2, %for.body53.lr.ph ], [ %add193, %for.body53 ]
36 %add58 = add nsw i32 %t7.014, 2
37 %arrayidx70 = getelementptr inbounds float, float* %cc, i64 0
38 %arrayidx72 = getelementptr inbounds float, float* %cc, i64 0
39 %arrayidx77 = getelementptr inbounds float, float* %cc, i64 0
40 %arrayidx81 = getelementptr inbounds float, float* %cc, i64 0
41 %arrayidx84 = getelementptr inbounds float, float* %cc, i64 0
42 %arrayidx95 = getelementptr inbounds float, float* %cc, i64 0
43 %arrayidx105 = getelementptr inbounds float, float* %cc, i64 0
44 %arrayidx110 = getelementptr inbounds float, float* %ch, i64 0
45 store float undef, float* %arrayidx110, align 4
46 %arrayidx122 = getelementptr inbounds float, float* %wa1, i64 0
47 %add129 = add nsw i32 %add58, %mul
48 %idxprom142 = sext i32 %add129 to i64
49 %arrayidx143 = getelementptr inbounds float, float* %ch, i64 %idxprom142
50 store float undef, float* %arrayidx143, align 4
51 %add153 = add nsw i32 %add129, %mul
52 %arrayidx170 = getelementptr inbounds float, float* %wa3, i64 0
53 %arrayidx174 = getelementptr inbounds float, float* %wa3, i64 0
54 %add177 = add nsw i32 %add153, %mul
55 %sub178 = add nsw i32 %add177, -1
56 %idxprom179 = sext i32 %sub178 to i64
57 %arrayidx180 = getelementptr inbounds float, float* %ch, i64 %idxprom179
58 store float undef, float* %arrayidx180, align 4
59 %arrayidx183 = getelementptr inbounds float, float* %wa3, i64 0
60 %0 = load float* %arrayidx183, align 4
61 %mul184 = fmul float undef, %0
62 %add189 = fadd float %mul184, 0.000000e+00
63 %idxprom190 = sext i32 %add177 to i64
64 %arrayidx191 = getelementptr inbounds float, float* %ch, i64 %idxprom190
65 store float %add189, float* %arrayidx191, align 4
66 %add193 = add nsw i32 %i.013, 2
67 %cmp52 = icmp slt i32 %add193, %ido
68 br i1 %cmp52, label %for.body53, label %for.inc096
70 for.inc096: ; preds = %for.body53, %for.body47
71 br i1 undef, label %for.body47, label %for.end198
73 for.end198: ; preds = %for.inc096, %for.cond45.preheader
74 br i1 false, label %for.end256, label %L105
76 L105: ; preds = %for.end198, %if.end
79 for.end256: ; preds = %L105, %for.end198, %entry