xref: /llvm-project/llvm/test/CodeGen/X86/btq.ll (revision ee5585ed09aff2e54cb540fad4c33f0c93626b1b)
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s
3
4declare dso_local void @bar()
5
6define void @test1(i64 %foo) nounwind {
7; CHECK-LABEL: test1:
8; CHECK:       # %bb.0:
9; CHECK-NEXT:    btq $32, %rdi
10; CHECK-NEXT:    jb bar # TAILCALL
11; CHECK-NEXT:  # %bb.1: # %if.end
12; CHECK-NEXT:    retq
13  %and = and i64 %foo, 4294967296
14  %tobool = icmp eq i64 %and, 0
15  br i1 %tobool, label %if.end, label %if.then
16
17if.then:
18  tail call void @bar() nounwind
19  br label %if.end
20
21if.end:
22  ret void
23}
24
25define void @test2(i64 %foo) nounwind {
26; CHECK-LABEL: test2:
27; CHECK:       # %bb.0:
28; CHECK-NEXT:    testl %edi, %edi
29; CHECK-NEXT:    js bar # TAILCALL
30; CHECK-NEXT:  # %bb.1: # %if.end
31; CHECK-NEXT:    retq
32  %and = and i64 %foo, 2147483648
33  %tobool = icmp eq i64 %and, 0
34  br i1 %tobool, label %if.end, label %if.then
35
36if.then:
37  tail call void @bar() nounwind
38  br label %if.end
39
40if.end:
41  ret void
42}
43