• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X64
2# RUN: llc -mtriple=i386-linux-gnu   -run-pass=legalizer %s -o - | FileCheck %s --check-prefix=ALL --check-prefix=X32
3
4--- |
5
6  define i32 @test(i32 %a) {
7  entry:
8    %cmp = trunc i32 %a to i1
9    br i1 %cmp, label %if.then, label %if.else
10
11  if.then:                                          ; preds = %entry
12    ret i32 0
13
14  if.else:                                          ; preds = %entry
15    ret i32 1
16  }
17...
18---
19name:            test
20# ALL-LABEL: name:  test
21alignment:       4
22legalized:       false
23regBankSelected: false
24registers:
25  - { id: 0, class: _, preferred-register: '' }
26  - { id: 1, class: _, preferred-register: '' }
27  - { id: 2, class: _, preferred-register: '' }
28  - { id: 3, class: _, preferred-register: '' }
29# ALL:         %1:_(s1) = G_TRUNC %0(s32)
30# ALL-NEXT:    G_BRCOND %1(s1), %[[TRUE:bb.[0-9]+]]
31# ALL-NEXT:    G_BR %[[FALSE:bb.[0-9]+]]
32# ALL:       [[TRUE]].{{[a-zA-Z0-9.]+}}:
33# ALL-NEXT:    $eax = COPY %2(s32)
34# ALL-NEXT:    RET 0, implicit $eax
35# ALL:       [[FALSE]].{{[a-zA-Z0-9.]+}}:
36# ALL-NEXT:    $eax = COPY %3(s32)
37# ALL-NEXT:    RET 0, implicit $eax
38body:             |
39  bb.1.entry:
40    successors: %bb.2(0x40000000), %bb.3(0x40000000)
41    liveins: $edi
42
43    %0(s32) = COPY $edi
44    %2(s32) = G_CONSTANT i32 0
45    %3(s32) = G_CONSTANT i32 1
46    %1(s1) = G_TRUNC %0(s32)
47    G_BRCOND %1(s1), %bb.2
48    G_BR %bb.3
49
50  bb.2.if.then:
51    $eax = COPY %2(s32)
52    RET 0, implicit $eax
53
54  bb.3.if.else:
55    $eax = COPY %3(s32)
56    RET 0, implicit $eax
57
58...
59