File: fake-use-ld.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (43 lines) | stat: -rw-r--r-- 1,395 bytes parent folder | download | duplicates (6)
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
; RUN: llc -O0 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s

; Checks that fake uses of the FP stack do not cause a crash.
;
; /*******************************************************************/
; extern long double foo(long double, long double, long double);
;
; long double actual(long double p1, long double p2, long double p3) {
;   return fmal(p1, p2, p3);
; }
; /*******************************************************************/

define x86_fp80 @actual(x86_fp80 %p1, x86_fp80 %p2, x86_fp80 %p3) optdebug {
;
; CHECK: actual
;
entry:
  %p1.addr = alloca x86_fp80, align 16
  %p2.addr = alloca x86_fp80, align 16
  %p3.addr = alloca x86_fp80, align 16
  store x86_fp80 %p1, ptr %p1.addr, align 16
  store x86_fp80 %p2, ptr %p2.addr, align 16
  store x86_fp80 %p3, ptr %p3.addr, align 16
  %0 = load x86_fp80, ptr %p1.addr, align 16
  %1 = load x86_fp80, ptr %p2.addr, align 16
  %2 = load x86_fp80, ptr %p3.addr, align 16
;
; CHECK: callq{{.*}}foo
;
  %3 = call x86_fp80 @foo(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
  %4 = load x86_fp80, ptr %p1.addr, align 16
  call void (...) @llvm.fake.use(x86_fp80 %4)
  %5 = load x86_fp80, ptr %p2.addr, align 16
  call void (...) @llvm.fake.use(x86_fp80 %5)
  %6 = load x86_fp80, ptr %p3.addr, align 16
  call void (...) @llvm.fake.use(x86_fp80 %6)
;
; CHECK: ret
;
  ret x86_fp80 %3
}

declare x86_fp80 @foo(x86_fp80, x86_fp80, x86_fp80)