Skip to content

Commit

Permalink
GlobalISel: Remove block insertion legalizer check
Browse files Browse the repository at this point in the history
This report was broken. The passed null block would crash in the
remark constructor.

I have a patch which will introduce a new block, and it seems to work
fine. It doesn't require legalizing any instructions in the new block,
so it's possible those will be missed.
  • Loading branch information
arsenm committed Jun 10, 2023
1 parent 3c84819 commit 02d25c8
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) {
getAnalysis<GISelCSEAnalysisWrapperPass>().getCSEWrapper();
MachineOptimizationRemarkEmitter MORE(MF, /*MBFI=*/nullptr);

const size_t NumBlocks = MF.size();

std::unique_ptr<MachineIRBuilder> MIRBuilder;
GISelCSEInfo *CSEInfo = nullptr;
bool EnableCSE = EnableCSEInLegalizer.getNumOccurrences()
Expand Down Expand Up @@ -355,16 +353,6 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) {
"unable to legalize instruction", *Result.FailedOn);
return false;
}
// For now don't support if new blocks are inserted - we would need to fix the
// outer loop for that.
if (MF.size() != NumBlocks) {
MachineOptimizationRemarkMissed R("gisel-legalize", "GISelFailure",
MF.getFunction().getSubprogram(),
/*MBB=*/nullptr);
R << "inserting blocks is not supported yet";
reportGISelFailure(MF, TPC, MORE, R);
return false;
}

if (LocObserver.getNumLostDebugLocs()) {
MachineOptimizationRemarkMissed R("gisel-legalize", "LostDebugLoc",
Expand Down

0 comments on commit 02d25c8

Please sign in to comment.