xref: /llvm-project/llvm/test/CodeGen/X86/fast-isel-medium-code-model.ll (revision c64334fb30f8a8087c218b6d7ec954ad47b33947)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel -fast-isel-abort=3 -code-model=medium -large-data-threshold=5 < %s | FileCheck %s
3; RUN: llc -mtriple=x86_64-linux-gnu -fast-isel -code-model=medium -large-data-threshold=3 < %s -o /dev/null \
4; RUN:   -pass-remarks-output=- -pass-remarks-filter=sdagisel | FileCheck %s --check-prefix=FALLBACK --implicit-check-not=missed
5
6declare void @foo()
7
8define void @call_foo() {
9; CHECK-LABEL: call_foo:
10; CHECK:       # %bb.0:
11; CHECK-NEXT:    pushq %rax
12; CHECK-NEXT:    .cfi_def_cfa_offset 16
13; CHECK-NEXT:    callq foo@PLT
14; CHECK-NEXT:    popq %rax
15; CHECK-NEXT:    .cfi_def_cfa_offset 8
16; CHECK-NEXT:    retq
17  call void @foo()
18  ret void
19}
20
21@g = internal global i32 42
22
23; FALLBACK: FastISel missed terminator
24; FALLBACK: in function: g_addr
25
26define ptr @g_addr() {
27; CHECK-LABEL: g_addr:
28; CHECK:       # %bb.0:
29; CHECK-NEXT:    movabsq $g, %rax
30; CHECK-NEXT:    retq
31  ret ptr @g
32}
33
34; FALLBACK: FastISel missed
35; FALLBACK: in function: load_g
36
37define i32 @load_g() {
38; CHECK-LABEL: load_g:
39; CHECK:       # %bb.0:
40; CHECK-NEXT:    movl g, %eax
41; CHECK-NEXT:    retq
42  %i = load i32, ptr @g
43  ret i32 %i
44}
45