[PATCH] D49364: [ARM] Add support for spilling high registers in Thumb1

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 19 18:46:53 PDT 2018


efriedma added a subscriber: wmi.
efriedma added a comment.

> Sorry, the mentioned idea with the copy is not quite clear to me. Could you please explain it a bit more for me?

Say the target has a new hook, call it "getRegClassForStackSaveRestore()" or something, which takes a register class, and returns a register class appropriate for stack save/restore operations.  Then when a register allocator wants to spill a vreg, it first calls getRegClassForStackSaveRestore(); if that returns a new register class, instead of spilling using storeRegToStackSlot, it makes a new vreg with the returned class, and inserts a COPY to that vreg.

This avoids having to scavenge a register later; the register allocator has more ways to make a register available, so the resulting code is likely more efficient, and it avoids the potential problem of needing to scavenge multiple registers in ThumbRegisterInfo::eliminateFrameIndex.


https://reviews.llvm.org/D49364





More information about the llvm-commits mailing list