1 ; RUN: llc < %s -mcpu=generic -mtriple=i686-- -mattr=+sse | FileCheck %s
3 define float @chainfail1(i64* nocapture %a, i64* nocapture %b, i32 %x, i32 %y, float* nocapture %f) nounwind uwtable noinline ssp {
5 %tmp1 = load i64, i64* %a, align 8
6 ; Insure x87 ops are properly chained, order preserved.
8 %conv = sitofp i64 %tmp1 to float
10 store float %conv, float* %f, align 4
12 %div = sdiv i32 %x, %y
13 %conv5 = sext i32 %div to i64
14 store i64 %conv5, i64* %b, align 8
18 define float @chainfail2(i64* nocapture %a, i64* nocapture %b, i32 %x, i32 %y, float* nocapture %f) nounwind uwtable noinline ssp {
21 store i64 0, i64* %b, align 8
22 %mul = mul nsw i32 %y, %x
23 %sub = add nsw i32 %mul, -1
24 %idxprom = sext i32 %sub to i64
25 %arrayidx = getelementptr inbounds i64, i64* %a, i64 %idxprom
26 %tmp4 = load i64, i64* %arrayidx, align 8
28 %conv = sitofp i64 %tmp4 to float
29 store float %conv, float* %f, align 4
33 define void @PR17495() {
35 br i1 undef, label %while.end, label %while.body
37 while.body: ; preds = %while.body, %entry
38 %x.1.copyload = load i24, i24* undef, align 1
39 %conv = sitofp i24 %x.1.copyload to float
40 %div = fmul float %conv, 0x3E80000000000000
41 store float %div, float* undef, align 4
42 br i1 false, label %while.end, label %while.body
44 while.end: ; preds = %while.body, %entry
47 ; CHECK-LABEL: @PR17495