mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
AMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()
Summary: This fixes an issue on MIPS where the infinite-loop-evergreen.ll test was failing to terminate. Fixes PR24147. Reviewers: arsenm, dsanders Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11260 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1732,18 +1732,9 @@ AMDGPUCFGStructurizer::normalizeInfiniteLoopExit(MachineLoop* LoopRep) {
|
|||||||
FuncRep->push_back(DummyExitBlk); //insert to function
|
FuncRep->push_back(DummyExitBlk); //insert to function
|
||||||
SHOWNEWBLK(DummyExitBlk, "DummyExitBlock to normalize infiniteLoop: ");
|
SHOWNEWBLK(DummyExitBlk, "DummyExitBlock to normalize infiniteLoop: ");
|
||||||
DEBUG(dbgs() << "Old branch instr: " << *BranchMI << "\n";);
|
DEBUG(dbgs() << "Old branch instr: " << *BranchMI << "\n";);
|
||||||
MachineBasicBlock::iterator I = BranchMI;
|
LLVMContext &Ctx = LoopHeader->getParent()->getFunction()->getContext();
|
||||||
unsigned ImmReg = FuncRep->getRegInfo().createVirtualRegister(I32RC);
|
Ctx.emitError("Extra register needed to handle CFG");
|
||||||
llvm_unreachable("Extra register needed to handle CFG");
|
return nullptr;
|
||||||
MachineInstr *NewMI = insertInstrBefore(I, AMDGPU::BRANCH_COND_i32);
|
|
||||||
MachineInstrBuilder MIB(*FuncRep, NewMI);
|
|
||||||
MIB.addMBB(LoopHeader);
|
|
||||||
MIB.addReg(ImmReg, false);
|
|
||||||
SHOWNEWINSTR(NewMI);
|
|
||||||
BranchMI->eraseFromParent();
|
|
||||||
LoopLatch->addSuccessor(DummyExitBlk);
|
|
||||||
|
|
||||||
return DummyExitBlk;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AMDGPUCFGStructurizer::removeUnconditionalBranch(MachineBasicBlock *MBB) {
|
void AMDGPUCFGStructurizer::removeUnconditionalBranch(MachineBasicBlock *MBB) {
|
||||||
|
Reference in New Issue
Block a user