1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=x86_64-linux-gnu -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK
6 define i32 @test(i32 %a) {
8 %cmp = trunc i32 %a to i1
9 br i1 %cmp, label %true, label %false
11 true: ; preds = %entry
14 false: ; preds = %entry
25 - { id: 0, class: gpr, preferred-register: '' }
26 - { id: 1, class: gpr, preferred-register: '' }
27 - { id: 2, class: gpr, preferred-register: '' }
28 - { id: 3, class: gpr, preferred-register: '' }
30 ; CHECK-LABEL: name: test
32 ; CHECK-NEXT: successors: %bb.1(0x40000000), %bb.2(0x40000000)
33 ; CHECK-NEXT: liveins: $edi
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gr32 = COPY $edi
36 ; CHECK-NEXT: [[MOV32r0_:%[0-9]+]]:gr32 = MOV32r0 implicit-def dead $eflags
37 ; CHECK-NEXT: [[MOV32ri:%[0-9]+]]:gr32 = MOV32ri 1
38 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gr8 = COPY [[COPY]].sub_8bit
39 ; CHECK-NEXT: TEST8ri [[COPY1]], 1, implicit-def $eflags
40 ; CHECK-NEXT: JCC_1 %bb.1, 5, implicit $eflags
41 ; CHECK-NEXT: JMP_1 %bb.2
43 ; CHECK-NEXT: bb.1.true:
44 ; CHECK-NEXT: $eax = COPY [[MOV32r0_]]
45 ; CHECK-NEXT: RET 0, implicit $eax
47 ; CHECK-NEXT: bb.2.false:
48 ; CHECK-NEXT: $eax = COPY [[MOV32ri]]
49 ; CHECK-NEXT: RET 0, implicit $eax
51 successors: %bb.2(0x40000000), %bb.3(0x40000000)
55 %2(s32) = G_CONSTANT i32 0
56 %3(s32) = G_CONSTANT i32 1
57 %1(s1) = G_TRUNC %0(s32)
58 G_BRCOND %1(s1), %bb.2