[PATCH] D11260: AMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()
Tom Stellard
thomas.stellard at amd.com
Thu Jul 16 06:25:38 PDT 2015
tstellarAMD created this revision.
tstellarAMD added reviewers: arsenm, dsanders.
tstellarAMD added a subscriber: llvm-commits.
This fixes an issue on MIPS where the infinite-loop-evegreen.ll test
was failing to terminate.
http://reviews.llvm.org/D11260
Files:
lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
Index: lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
===================================================================
--- lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
+++ lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
@@ -1734,16 +1734,9 @@
DEBUG(dbgs() << "Old branch instr: " << *BranchMI << "\n";);
MachineBasicBlock::iterator I = BranchMI;
unsigned ImmReg = FuncRep->getRegInfo().createVirtualRegister(I32RC);
- llvm_unreachable("Extra register needed to handle CFG");
- 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;
+ LLVMContext &Ctx = LoopHeader->getParent()->getFunction()->getContext();
+ Ctx.emitError("Extra register needed to handle CFG");
+ return nullptr;
}
void AMDGPUCFGStructurizer::removeUnconditionalBranch(MachineBasicBlock *MBB) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11260.29899.patch
Type: text/x-patch
Size: 1013 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150716/37b2eaaf/attachment.bin>
More information about the llvm-commits
mailing list