[PATCH] D86215: [TableGen][GlobalISel] Fix handling of zero_reg

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 19 09:41:41 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/utils/TableGen/GlobalISelEmitter.cpp:2656
+      Table << MatchTable::Comment("zero_reg");
+      Table << MatchTable::IntValue(0);
+    }
----------------
ehjogab wrote:
> arsenm wrote:
> > Could this use TargetNamespace::NoRegister?
> I suppose that works. I checked for our target and NoRegister is indeed assigned value 0, so the semantics would be the same. But I am not sure whether that would work for all targets. If it does, I do believe your suggestion to be a better solution than to simply output value 0. Perhaps someone more knowledgeable regarding TableGen could comment on this?
That's generated for all targets. 0 is always $noreg, with an added NoRegister entry.

I also think zero_reg should really be renamed to $noreg or something closer to what it really is


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86215



More information about the llvm-commits mailing list