xref: /aosp_15_r20/external/llvm/test/CodeGen/X86/btq.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -march=x86-64 | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workerdeclare void @bar()
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine void @test1(i64 %foo) nounwind {
6*9880d681SAndroid Build Coastguard Worker  %and = and i64 %foo, 4294967296
7*9880d681SAndroid Build Coastguard Worker  %tobool = icmp eq i64 %and, 0
8*9880d681SAndroid Build Coastguard Worker  br i1 %tobool, label %if.end, label %if.then
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test1:
11*9880d681SAndroid Build Coastguard Worker; CHECK: btq $32
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Workerif.then:
14*9880d681SAndroid Build Coastguard Worker  tail call void @bar() nounwind
15*9880d681SAndroid Build Coastguard Worker  br label %if.end
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerif.end:
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerdefine void @test2(i64 %foo) nounwind {
22*9880d681SAndroid Build Coastguard Worker  %and = and i64 %foo, 2147483648
23*9880d681SAndroid Build Coastguard Worker  %tobool = icmp eq i64 %and, 0
24*9880d681SAndroid Build Coastguard Worker  br i1 %tobool, label %if.end, label %if.then
25*9880d681SAndroid Build Coastguard Worker
26*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: test2:
27*9880d681SAndroid Build Coastguard Worker; CHECK: testl $-2147483648
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerif.then:
30*9880d681SAndroid Build Coastguard Worker  tail call void @bar() nounwind
31*9880d681SAndroid Build Coastguard Worker  br label %if.end
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerif.end:
34*9880d681SAndroid Build Coastguard Worker  ret void
35*9880d681SAndroid Build Coastguard Worker}
36