tbb-removeadd.mir
3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#RUN: llc -run-pass arm-cp-islands %s -o - | FileCheck %s
--- |
; ModuleID = 'test.ll'
source_filename = "test.c"
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "thumbv8r-arm-none-eabi"
define void @Func(i32 %i, i32* nocapture %p) local_unnamed_addr {
entry:
switch i32 %i, label %sw.epilog [
i32 0, label %sw.bb
i32 1, label %sw.bb1
i32 2, label %sw.epilog.sink.split
i32 4, label %sw.bb3
]
sw.bb: ; preds = %entry
br label %sw.epilog.sink.split
sw.bb1: ; preds = %entry
store i32 0, i32* %p, align 4
br label %sw.epilog.sink.split
sw.bb3: ; preds = %entry
br label %sw.epilog.sink.split
sw.epilog.sink.split: ; preds = %sw.bb3, %sw.bb1, %sw.bb, %entry
%.sink = phi i32 [ 2, %sw.bb3 ], [ 0, %sw.bb ], [ 1, %entry ], [ 1, %sw.bb1 ]
store i32 %.sink, i32* %p, align 4
br label %sw.epilog
sw.epilog: ; preds = %sw.epilog.sink.split, %entry
ret void
}
...
---
name: Func
alignment: 2
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
tracksRegLiveness: true
liveins:
- { reg: '$r0' }
- { reg: '$r1' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 0
adjustsStack: false
hasCalls: false
maxCallFrameSize: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
jumpTable:
kind: inline
entries:
- id: 0
blocks: [ '%bb.2.sw.bb', '%bb.3.sw.bb1', '%bb.5.sw.epilog.sink.split',
'%bb.6.sw.epilog', '%bb.4.sw.bb3' ]
# The ADD should be deleted along with the LEA
# CHECK-NOT: t2LEApcrelJT
# CHECK-NOT: t2ADDrs
# CHECK: tMOVi8
# CHECK: t2TBB_JT
body: |
bb.0.entry:
successors: %bb.6.sw.epilog(0x0ccccccb), %bb.1.entry(0x73333335)
liveins: $r0, $r1
tCMPi8 $r0, 4, 14, $noreg, implicit-def $cpsr
t2Bcc %bb.6.sw.epilog, 8, killed $cpsr
bb.1.entry:
successors: %bb.2.sw.bb(0x1c71c71c), %bb.3.sw.bb1(0x1c71c71c), %bb.5.sw.epilog.sink.split(0x1c71c71c), %bb.6.sw.epilog(0x0e38e38e), %bb.4.sw.bb3(0x1c71c71c)
liveins: $r0, $r1
$r2 = t2LEApcrelJT %jump-table.0, 14, $noreg
$r3 = t2ADDrs killed $r2, $r0, 18, 14, $noreg, $noreg
$r2, dead $cpsr = tMOVi8 1, 14, $noreg
t2BR_JT killed $r3, killed $r0, %jump-table.0
bb.2.sw.bb:
successors: %bb.5.sw.epilog.sink.split(0x80000000)
liveins: $r1
$r2, dead $cpsr = tMOVi8 0, 14, $noreg
t2B %bb.5.sw.epilog.sink.split, 14, $noreg
bb.3.sw.bb1:
successors: %bb.5.sw.epilog.sink.split(0x80000000)
liveins: $r1
$r0, dead $cpsr = tMOVi8 0, 14, $noreg
$r2, dead $cpsr = tMOVi8 1, 14, $noreg
tSTRi killed $r0, $r1, 0, 14, $noreg :: (store 4 into %ir.p)
t2B %bb.5.sw.epilog.sink.split, 14, $noreg
bb.4.sw.bb3:
successors: %bb.5.sw.epilog.sink.split(0x80000000)
liveins: $r1
$r2, dead $cpsr = tMOVi8 2, 14, $noreg
bb.5.sw.epilog.sink.split:
successors: %bb.6.sw.epilog(0x80000000)
liveins: $r1, $r2
tSTRi killed $r2, killed $r1, 0, 14, $noreg :: (store 4 into %ir.p)
bb.6.sw.epilog:
tBX_RET 14, $noreg
...