xref: /llvm-project/llvm/test/CodeGen/PowerPC/setcr_bc3.mir (revision fae05692a36f9ebbd201d93c2a6b0f927564d7e6)
1# RUN: llc -verify-machineinstrs -start-before=ppc-pre-emit-peephole %s -o - | FileCheck %s
2--- |
3  target datalayout = "e-m:e-i64:64-n32:64"
4  target triple = "powerpc64le-unknown-linux-gnu"
5
6  declare signext i32 @callee(i32 signext)
7
8  define signext i32 @func(i32 signext %v) {
9    ret i32 0
10  }
11...
12---
13name:            func
14alignment:       16
15exposesReturnsTwice: false
16legalized:       false
17regBankSelected: false
18selected:        false
19failedISel:      false
20tracksRegLiveness: true
21registers:
22liveins:
23  - { reg: '$x3', virtual-reg: '' }
24frameInfo:
25  isFrameAddressTaken: false
26  isReturnAddressTaken: false
27  hasStackMap:     false
28  hasPatchPoint:   false
29  stackSize:       48
30  offsetAdjustment: 0
31  maxAlignment:    0
32  adjustsStack:    true
33  hasCalls:        true
34  stackProtector:  ''
35  maxCallFrameSize: 32
36  hasOpaqueSPAdjustment: false
37  hasVAStart:      false
38  hasMustTailInVarArgFunc: false
39  localFrameSize:  0
40  savePoint:       ''
41  restorePoint:    ''
42fixedStack:
43  - { id: 0, type: spill-slot, offset: -16, size: 8, alignment: 16, stack-id: default,
44      callee-saved-register: '$x30', callee-saved-restored: true, debug-info-variable: '',
45      debug-info-expression: '', debug-info-location: '' }
46stack:
47constants:
48
49body:             |
50  bb.0:
51    successors: %bb.2(0x30000000), %bb.1(0x50000000)
52    liveins: $x3, $x30
53
54    ; bc should be converted into b
55    ; CHECK-LABEL: func
56    ; CHECK: # %bb.1
57    ; CHECK: creqv
58    ; CHECK-NOT: bc
59    ; CHECK: b .LBB0_3
60    ; CHECK: .LBB0_2
61
62    $x0 = MFLR8 implicit $lr8
63    STD killed $x0, 16, $x1
64    $x1 = STDU $x1, -48, $x1
65    STD killed $x30, 32, $x1 :: (store (s64) into %fixed-stack.0, align 16)
66    $x30 = OR8 $x3, $x3
67    BL8_NOP @callee, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def $x3
68    renamable $cr0 = CMPLWI renamable $r3, 0
69    BCC 76, killed renamable $cr0, %bb.2
70
71  bb.1:
72    successors: %bb.5(0x40000000), %bb.2(0x40000000)
73    liveins: $x3
74
75    renamable $x3 = EXTSW_32_64 killed renamable $r3, implicit $x3
76    BL8_NOP @callee, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def $x3
77    renamable $cr2un = CRSET
78    $cr2gt = CROR $cr2un, $cr2un
79    $x30 = OR8 killed $x3, $x3
80    BC killed renamable $cr2un, %bb.5
81    B %bb.2
82
83  bb.4:
84    successors: %bb.5(0x80000000)
85    liveins: $x30
86
87    $x3 = LI8 0
88    BL8_NOP @callee, csr_ppc64_altivec, implicit-def dead $lr8, implicit $rm, implicit killed $x3, implicit $x2, implicit-def $r1, implicit-def dead $x3
89
90  bb.5:
91    liveins: $x30
92
93    renamable $x3 = EXTSW_32_64 killed renamable $r30, implicit $x30
94    $x30 = LD 32, $x1 :: (load (s64) from %fixed-stack.0, align 16)
95    $x1 = ADDI8 $x1, 48
96    $x0 = LD 16, $x1
97    MTLR8 killed $x0, implicit-def $lr8
98    BLR8 implicit $lr8, implicit $rm, implicit killed $x3
99
100  bb.2:
101    successors: %bb.5(0x40000000), %bb.4(0x40000000)
102    liveins: $x30
103
104    renamable $cr0 = CMPWI renamable $r30, -1
105    BCn killed renamable $cr0gt, %bb.4
106    B %bb.5
107
108...
109