Skip to content

Commit 30d10a9

Browse files
author
Mikhail Gudim
committed
Add a test for multiple save locations of a CSR.
Technically, it is possible that the a callee-saved register is saved in different locations. CFIInstrInserter should handle this, but currently it does not.
1 parent 7287816 commit 30d10a9

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# RUN: llc %s -mtriple=riscv64 \
2+
# RUN: -run-pass=cfi-instr-inserter \
3+
# RUN: -riscv-enable-cfi-instr-inserter=true
4+
# XFAIL: *
5+
6+
# Technically, it is possible that the a callee-saved register is saved in different locations.
7+
# CFIInstrInserter should handle this, but currently it does not.
8+
---
9+
name: multiple_locations
10+
tracksRegLiveness: true
11+
body: |
12+
bb.0.entry:
13+
liveins: $x10, $x9, $x2
14+
BEQ $x10, $x0, %bb.3
15+
PseudoBR %bb.2
16+
17+
bb.1:
18+
liveins: $x10, $x9, $x2
19+
$x5 = COPY $x9
20+
CFI_INSTRUCTION register $x9, $x5
21+
$x9 = COPY $x5
22+
CFI_INSTRUCTION register $x9, $x9
23+
PseudoBR %bb.3
24+
25+
bb.2:
26+
liveins: $x10, $x9, $x2
27+
SD $x9, $x2, 0 :: (store (s64))
28+
CFI_INSTRUCTION offset $x9, 0
29+
$x9 = LD $x2, 0 :: (load (s64))
30+
CFI_INSTRUCTION register $x9, $x9
31+
PseudoBR %bb.3
32+
33+
bb.3:
34+
PseudoRET
35+
...

0 commit comments

Comments
 (0)