File: 2011-06-03-x87chain.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (49 lines) | stat: -rw-r--r-- 1,554 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
; RUN: llc < %s -mcpu=generic -mtriple=i686-- -mattr=+sse | FileCheck %s

define float @chainfail1(ptr nocapture %a, ptr nocapture %b, i32 %x, i32 %y, ptr nocapture %f) nounwind uwtable noinline ssp {
entry:
  %tmp1 = load i64, ptr %a, align 8
; Insure x87 ops are properly chained, order preserved.
; CHECK: fildll
  %conv = sitofp i64 %tmp1 to float
; CHECK: fstps
  store float %conv, ptr %f, align 4
; CHECK: idivl
  %div = sdiv i32 %x, %y
  %conv5 = sext i32 %div to i64
  store i64 %conv5, ptr %b, align 8
  ret float %conv
}

define float @chainfail2(ptr nocapture %a, ptr nocapture %b, i32 %x, i32 %y, ptr nocapture %f) nounwind uwtable noinline ssp {
entry:
; CHECK: movl $0,
  store i64 0, ptr %b, align 8
  %mul = mul nsw i32 %y, %x
  %sub = add nsw i32 %mul, -1
  %idxprom = sext i32 %sub to i64
  %arrayidx = getelementptr inbounds i64, ptr %a, i64 %idxprom
  %tmp4 = load i64, ptr %arrayidx, align 8
; CHECK: fildll
  %conv = sitofp i64 %tmp4 to float
  store float %conv, ptr %f, align 4
  ret float %conv
}

define void @PR17495() {
entry:
  br i1 undef, label %while.end, label %while.body

while.body:                                       ; preds = %while.body, %entry
  %x.1.copyload = load i24, ptr undef, align 1
  %conv = sitofp i24 %x.1.copyload to float
  %div = fmul float %conv, 0x3E80000000000000
  store float %div, ptr undef, align 4
  br i1 false, label %while.end, label %while.body

while.end:                                        ; preds = %while.body, %entry
  ret void

; CHECK-LABEL: @PR17495
; CHECK-NOT: fildll
}