[PATCH] D128437: [fastregalloc] Fix bug when there is no register class.

LuoYuanke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 23 06:39:37 PDT 2022


LuoYuanke added inline comments.


================
Comment at: llvm/lib/CodeGen/RegAllocFast.cpp:307-310
+  // Follow the default behaviour to return true if there is no
+  // register class for the register. This may happen in gloal ISel.
+  if (!RC)
+    return true;
----------------
LuoYuanke wrote:
> arsenm wrote:
> > This should not happen. This is a bug in x86 globalisel. Virtual registers without a class should not get past the selector. The verifier should catch this
> I'm not familiar with globalisel, but there is no harm for this patch. It just trigger the bug of globalisel. Can we land it first to let the lit test pass? We can debug and create another patch for globalisel if there is a bug in it.
We can't trigger the bug with `-verify-machineinstrs`. There may be a bug in handling DBG_VALUE in globalisel.
`DBG_VALUE %0:gpr, $noreg, !"argc", !DIExpression(), debug-location !19; foo.c:11:14 line no:11`

However I think it is irrelevant to this patch.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128437/new/

https://reviews.llvm.org/D128437



More information about the llvm-commits mailing list