[PATCH] [mips] Reserve $at and use it for frame pointer elimination.

Vladimir Stefanovic vladimir.stefanovic at imgtec.com
Wed Dec 3 11:31:32 PST 2014


When RegScavenger runs out of registers, it tries to spill one. So it generates
e.g.

  SW %RA<kill>, <fi#11>, 0

which is converted by eliminateFI() into:

  SW %RA<kill>, %FP, Offset

for offsets that fit into 16 bits. Otherwise, we need yet another register:

	%vreg79<def> = LUi 1
	%vreg79<def> = ADDu %FP, %vreg79<kill>
	SW %RA<kill>, %vreg79<kill>, 120

Then RegScavenger is called to provide a register for vreg79, so it asserts with
"Cannot scavenge register without an emergency spill slot!".


There is a number of mips tests that fail when $at is reserved, because they
have hardcoded expected register values, and will have to be fixed if this
patch gets accepted.

http://reviews.llvm.org/D6509






More information about the llvm-commits mailing list