mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 07:34:45 +01:00
[InlineSpiller] add assert about spills post terminators
Summary: This invariant is being violated in the test case https://reviews.llvm.org/D77849, related to the use of the relatively new ability for callbr to have return values, and MachineBasicBlocks with INLINEASM_BR terminators to emit live out register defs. As noted in the comment, this triggers invariant violations in MachineVerifier via `llc -verify-machineinstrs` or `llc -verify-regalloc`, since only MachineInstrs that are terminators are allowed to follow the first terminator. https://reviews.llvm.org/D75098 may rework this very assertion if we're spilling via a (proposed) TCOPY MachineInstr. Reviewers: void, efriedma, arsenm Reviewed By: efriedma Subscribers: qcolombet, wdng, hiraditya, llvm-commits, srhines Tags: #llvm Differential Revision: https://reviews.llvm.org/D78166
This commit is contained in:
@@ -945,6 +945,9 @@ static bool isRealSpill(const MachineInstr &Def) {
|
||||
/// insertSpill - Insert a spill of NewVReg after MI.
|
||||
void InlineSpiller::insertSpill(unsigned NewVReg, bool isKill,
|
||||
MachineBasicBlock::iterator MI) {
|
||||
// Spill are not terminators, so inserting spills after terminators will
|
||||
// violate invariants in MachineVerifier.
|
||||
assert(!MI->isTerminator() && "Inserting a spill after a terminator");
|
||||
MachineBasicBlock &MBB = *MI->getParent();
|
||||
|
||||
MachineInstrSpan MIS(MI, &MBB);
|
||||
|
||||
Reference in New Issue
Block a user