[PATCH] D152397: GlobalISel: Remove block insertion legalizer check

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 14:25:14 PDT 2023


arsenm created this revision.
arsenm added reviewers: aemerson, paquette, Pierre-vh, dsanders, bogner.
Herald added a subscriber: hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

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.


https://reviews.llvm.org/D152397

Files:
  llvm/lib/CodeGen/GlobalISel/Legalizer.cpp


Index: llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -355,16 +355,6 @@
                        "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",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152397.529435.patch
Type: text/x-patch
Size: 913 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/464b2946/attachment.bin>


More information about the llvm-commits mailing list