RegAlloc: try to fail more gracefully when out of registers
authorNicolai Haehnle <nhaehnle@gmail.com>
Wed, 15 May 2019 17:29:58 +0000 (17:29 +0000)
committerNicolai Haehnle <nhaehnle@gmail.com>
Wed, 15 May 2019 17:29:58 +0000 (17:29 +0000)
commit664ceeda6857801875f9ca473c6fea6792155249
treeae1497bd7b88ca2af1dfbcf670f17f0b1c930189
parent42d28be802fe5beab18bc1a27f89894c0a290d44
RegAlloc: try to fail more gracefully when out of registers

Summary:
The emitError path allows the program to continue, unlike report_fatal_error.
This is friendlier to use cases where LLVM is embedded in a larger program,
because the caller may be able to deal with the error somewhat gracefully.

Change the number of requested NOP bytes in the AArch64 and PowerPC
test cases to avoid triggering an unrelated assertion. The compilation
still fails, as verified by the test.

Change-Id: Iafb9ca341002a597b82e59ddc7a1f13c78758e3d

Reviewers: arsenm, MatzeB

Subscribers: qcolombet, nemanjai, wdng, javed.absar, kristof.beyls, kbarton, jsji, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61489

llvm-svn: 360786
llvm/lib/CodeGen/RegAllocBase.cpp
llvm/test/CodeGen/AArch64/arm64-anyregcc-crash.ll
llvm/test/CodeGen/PowerPC/ppc64-anyregcc-crash.ll
llvm/test/CodeGen/X86/anyregcc-crash.ll