[PATCH] D16831: [regalloc][WinEH] Do not mark intervals as not spillable if they contain a regmask

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 16:52:43 PST 2016

andrew.w.kaylor created this revision.
andrew.w.kaylor added reviewers: MatzeB, majnemer, rnk, JosephTremoulet.
andrew.w.kaylor added a subscriber: llvm-commits.
andrew.w.kaylor set the repository for this revision to rL LLVM.
Herald added subscribers: qcolombet, MatzeB.

Currently VirtRegAuxInfo::calculateSpillWeightAndHint() marks an interval as not spillable if no live segments in the interval span instructions.  However, if the interval contains a regmask location (particularly a Windows EH unwind edge, which clobbers all registers) spilling may be required.  This patch adds a check for regmasks before marking an interval as not spillable.

The included test case was reduced from a C++ program that failed to compile, reporting "LLVM ERROR: ran out of registers during register allocation."  In the failing case, the greedy register allocator split an interval to the point that it contained the following two ranges: [536r,584r:0)[608B,624r:0) with a copy def at 536 (in BB#3) and a use at 624 (in BB#5).  Because no live segments in the interval span instructions the interval was marked as not spillable.  However, because 608B was the start of an EH pad block, there were no legal registers for the interval.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16831.46722.patch
Type: text/x-patch
Size: 5186 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160203/b936597e/attachment.bin>

More information about the llvm-commits mailing list