1 ; RUN: opt %loadPolly -S -polly-codegen < %s | FileCheck %s
3 ; This test case has a inner SCEV sdiv that will escape the SCoP. Just check we
4 ; do not crash and generate valid code.
6 ; CHECK: polly.split_new_and_old:
8 target triple = "x86_64-unknown-linux-gnu"
10 define i64 @_vorbis_apply_window(ptr %d, i64 %param) {
12 %0 = load ptr, ptr undef, align 8
13 %div23.neg = sdiv i64 0, -4
14 %sub24 = add i64 0, %div23.neg
15 br label %for.cond.30.preheader
17 for.cond.30.preheader: ; preds = %for.body, %entry
18 %sext = shl i64 %sub24, 32
19 %conv48.74 = ashr exact i64 %sext, 32
20 %div43 = sdiv i64 %param, 2
21 %cmp49.75 = icmp slt i64 %conv48.74, 0
22 br i1 %cmp49.75, label %for.body.51.lr.ph, label %for.cond.60.preheader
24 for.body.51.lr.ph: ; preds = %for.cond.30.preheader
25 %div44 = sdiv i64 %div43, 2
26 %sub45 = add nsw i64 %div44, 4294967295
27 %1 = trunc i64 %sub45 to i32
28 %2 = sext i32 %1 to i64
31 for.cond.60.preheader: ; preds = %for.body.51, %for.cond.30.preheader
32 %div44.m = phi i64 [%div44, %for.body.51], [ 0, %for.cond.30.preheader]
33 br i1 true, label %end, label %for.cond.30.preheader
38 for.body.51: ; preds = %for.body.51, %for.body.51.lr.ph
39 %indvars.iv86 = phi i64 [ %2, %for.body.51.lr.ph ], [ undef, %for.body.51 ]
40 %arrayidx53 = getelementptr inbounds float, ptr %0, i64 %indvars.iv86
41 %3 = load float, ptr %arrayidx53, align 4
42 %mul56 = fmul float %3, undef
43 store float %mul56, ptr %d, align 4
44 br i1 false, label %for.body.51, label %for.cond.60.preheader