delay-slot-filler-bundled-insts-def-use.mir
3.06 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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
## Check that the delay-slot filler looks at the registers defined by BUNDLE instructions
# RUN: llc %s -run-pass=mips-delay-slot-filler -verify-machineinstrs -o - | FileCheck %s
--- |
; ModuleID = '/Users/alex/cheri/llvm-project/llvm/test/CodeGen/Mips/delay-test.ll'
source_filename = "/Users/alex/cheri/llvm-project/llvm/test/CodeGen/Mips/delay-test.ll"
target datalayout = "E-m:e-i8:8:32-i16:16:32-i64:64-n32:64-S128"
target triple = "mips64-unknown-freebsd"
; Function Attrs: nounwind
define i64 @test(i1 %cond) local_unnamed_addr #0 {
entry:
br i1 %cond, label %err, label %return
err: ; preds = %entry
unreachable
return: ; preds = %entry
ret i64 1
}
attributes #0 = { nounwind }
...
---
name: test
alignment: 8
exposesReturnsTwice: false
legalized: false
regBankSelected: false
selected: false
failedISel: false
tracksRegLiveness: true
hasWinCFI: false
registers: []
liveins:
- { reg: '$a0_64', virtual-reg: '' }
frameInfo:
isFrameAddressTaken: false
isReturnAddressTaken: false
hasStackMap: false
hasPatchPoint: false
stackSize: 0
offsetAdjustment: 0
maxAlignment: 1
adjustsStack: false
hasCalls: false
stackProtector: ''
maxCallFrameSize: 0
cvBytesOfCalleeSavedRegisters: 0
hasOpaqueSPAdjustment: false
hasVAStart: false
hasMustTailInVarArgFunc: false
localFrameSize: 0
savePoint: ''
restorePoint: ''
fixedStack: []
stack: []
callSites: []
constants: []
machineFunctionInfo: {}
body: |
; CHECK-LABEL: name: test
; CHECK: bb.0.entry:
; CHECK: successors: %bb.2(0x00000001), %bb.1(0x7fffffff)
; CHECK: renamable $at = SLL renamable $a0, 0, implicit killed $a0_64
; CHECK: renamable $at = ANDi killed renamable $at, 1
; CHECK: $v0_64 = DADDiu $zero_64, 1
; CHECK: $v0_64 = DADDiu $v0_64, 1
; CHECK: BUNDLE implicit-def $v0_64 {
; CHECK: $v0_64 = DADDiu $zero_64, 1
; CHECK: $v0_64 = DADDiu $v0_64, 1
; CHECK: }
; CHECK: BNE killed renamable $at, $zero, %bb.2, implicit-def $at {
; CHECK: NOP
; CHECK: }
; CHECK: bb.1.return:
; CHECK: PseudoReturn64 undef $ra_64, implicit killed $v0_64 {
; CHECK: NOP
; CHECK: }
; CHECK: bb.2.err:
bb.0.entry:
successors: %bb.1(0x00000001), %bb.2(0x7fffffff)
liveins: $a0_64
renamable $at = SLL renamable $a0, 0, implicit killed $a0_64
renamable $at = ANDi killed renamable $at, 1
; Check that none of these instructions are hoisted after the BUNDLE to avoid
; incorrect values from being
$v0_64 = DADDiu $zero_64, 1
$v0_64 = DADDiu $v0_64, 1
BUNDLE implicit-def $v0_64 {
$v0_64 = DADDiu $zero_64, 1
$v0_64 = DADDiu $v0_64, 1
}
BNE killed renamable $at, $zero, %bb.1, implicit-def $at
bb.2.return:
liveins: $v0_64
PseudoReturn64 undef $ra_64, implicit killed $v0_64
bb.1.err:
...