[llvm-commits] [llvm] r147486 - /llvm/trunk/lib/CodeGen/VirtRegMap.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Tue Jan 3 14:34:31 PST 2012
Author: stoklund
Date: Tue Jan 3 16:34:31 2012
New Revision: 147486
URL: http://llvm.org/viewvc/llvm-project?rev=147486&view=rev
Log:
Assert when reserved registers have been assigned.
This can only happen if the set of reserved registers changes during
register allocation.
<rdar://problem/10625436>
Modified:
llvm/trunk/lib/CodeGen/VirtRegMap.cpp
Modified: llvm/trunk/lib/CodeGen/VirtRegMap.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/VirtRegMap.cpp?rev=147486&r1=147485&r2=147486&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/VirtRegMap.cpp (original)
+++ llvm/trunk/lib/CodeGen/VirtRegMap.cpp Tue Jan 3 16:34:31 2012
@@ -112,6 +112,9 @@
SmallVector<unsigned, 8> SuperDeads;
SmallVector<unsigned, 8> SuperDefs;
SmallVector<unsigned, 8> SuperKills;
+#ifndef NDEBUG
+ BitVector Reserved = TRI->getReservedRegs(*MF);
+#endif
for (MachineFunction::iterator MBBI = MF->begin(), MBBE = MF->end();
MBBI != MBBE; ++MBBI) {
@@ -129,6 +132,7 @@
unsigned VirtReg = MO.getReg();
unsigned PhysReg = getPhys(VirtReg);
assert(PhysReg != NO_PHYS_REG && "Instruction uses unmapped VirtReg");
+ assert(!Reserved.test(PhysReg) && "Reserved register assignment");
// Preserve semantics of sub-register operands.
if (MO.getSubReg()) {
More information about the llvm-commits
mailing list