xref: /llvm-project/llvm/test/CodeGen/X86/tailcall-range.ll (revision 2dade0041a62b192e9bde24ae6bbe6208f027523)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2; RUN: llc -mtriple=x86_64-linux < %s | FileCheck %s
3
4define range(i32 0, 2) i32 @foo(ptr %this) {
5; CHECK-LABEL: foo:
6; CHECK:       # %bb.0: # %entry
7; CHECK-NEXT:    movzbl (%rdi), %eax
8; CHECK-NEXT:    retq
9entry:
10  %call = load volatile i1, ptr %this, align 1
11  %spec.select = zext i1 %call to i32
12  ret i32 %spec.select
13}
14
15define range(i32 0, 2) i32 @bar(ptr %this) {
16; CHECK-LABEL: bar:
17; CHECK:       # %bb.0: # %entry
18; CHECK-NEXT:    xorl %edi, %edi
19; CHECK-NEXT:    jmp foo@PLT # TAILCALL
20entry:
21  %ret = musttail call i32 @foo(ptr null)
22  ret i32 %ret
23}
24
25declare i64 @llvm.llround.f32(float) nounwind readnone
26define range(i64 0, 8) i64 @testmsxs(float %x) {
27; CHECK-LABEL: testmsxs:
28; CHECK:       # %bb.0: # %entry
29; CHECK-NEXT:    jmp llroundf@PLT # TAILCALL
30entry:
31  %ret = tail call i64 @llvm.llround.f32(float %x)
32  ret i64 %ret
33}
34
35declare i32 @callee()
36
37define range(i32 0, 2) i32 @func_with_range_attr() {
38; CHECK-LABEL: func_with_range_attr:
39; CHECK:       # %bb.0: # %entry
40; CHECK-NEXT:    jmp callee@PLT # TAILCALL
41entry:
42  %ret = musttail call i32 @callee()
43  ret i32 %ret
44}
45
46define i32 @call_with_range_attr() {
47; CHECK-LABEL: call_with_range_attr:
48; CHECK:       # %bb.0: # %entry
49; CHECK-NEXT:    jmp callee@PLT # TAILCALL
50entry:
51  %ret = musttail call range(i32 0, 2) i32 @callee()
52  ret i32 %ret
53}
54