Add a TargetIsa::allocatable_registers() method.

This gives the target ISA a chance to reserve registers like the stack
pointer or hard-wired 0 registers like %x0 on RISC-V.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-26 13:54:40 -07:00
parent 305de3e73b
commit bb8ae9a4fb
12 changed files with 85 additions and 19 deletions

View File

@@ -6,7 +6,8 @@ isa riscv
function add(i32, i32) {
ebb0(v1: i32, v2: i32):
v3 = iadd v1, v2
; check: [R#0c,%x0]
; TODO: This shouldn't clobber the link register.
; check: [R#0c,%x1]
; sameln: iadd
return
}