[PATCH] D119436: RFC: RegAlloc: Avoid repeated calls to freezeReservedRegs

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 29 05:39:20 PDT 2022


foad added a comment.

In D119436#3412647 <https://reviews.llvm.org/D119436#3412647>, @arsenm wrote:

> LGTM

Thanks but I can't commit it because I don't know how to fix this:

> FIXME: The assertion I added fails on a few AArch64 CodeGen tests,
> apparently because AArch64RegisterInfo::hasBasePointer changes after
> FinalizeISel. How should this be handled? Is the target required to
> call freezeReservedRegs again whenever the set of reserved regs might
> have changed?



================
Comment at: llvm/lib/CodeGen/RegAllocBase.cpp:64
   Matrix = &mat;
-  MRI->freezeReservedRegs(vrm.getMachineFunction());
+  if (MRI->reservedRegsFrozen()) {
+#ifndef NDEBUG
----------------
arsenm wrote:
> Can this just assert the regs are frozen? Why does anything reach here without having done this already?
Good point. Simplified accordingly.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119436



More information about the llvm-commits mailing list