This is an archive of the discontinued LLVM Phabricator instance.

[globalisel][tablegen] Generate TypeObject table. NFC
ClosedPublic

Authored by dsanders on Jul 31 2017, 5:28 AM.

Event Timeline

dsanders created this revision.Jul 31 2017, 5:28 AM
rovka edited edge metadata.Aug 2 2017, 7:04 AM

You should add checks for the GILLT enum in GlobalISelEmitter.td, since now it won't be the same enum for all targets.

utils/TableGen/GlobalISelEmitter.cpp
118–119

This is going to fall all the way to the unreachable if both types are invalid - you should check that case explicitly.

125

I think you can get rid of this check. If Ty.isVector, you check NumElements, and if that doesn't settle it then you can unconditionally look at the SizeInBits and it will be relevant for both scalars and vectors.

dsanders added inline comments.Aug 3 2017, 6:43 AM
utils/TableGen/GlobalISelEmitter.cpp
118–119

Well spotted.

125

I agree.

dsanders updated this revision to Diff 110210.Aug 8 2017, 8:37 AM
dsanders marked 4 inline comments as done.

Fixed the priority sort-order nits:

  • Returns false if both sides are invalid instead of aborting.
  • Avoid checking size-in-bits on separate code-paths and handle it in one place.
  • Also order pointers and pointer address spaces since there's no longer an unreachable for them to fall into.
rovka accepted this revision.Aug 11 2017, 2:06 AM

LGTM now.

This revision is now accepted and ready to land.Aug 11 2017, 2:06 AM
dsanders closed this revision.Aug 11 2017, 10:31 AM
dsanders reopened this revision.Aug 11 2017, 12:21 PM

This was reverted in order to revert D36084. Investigating the problem with D36084

This revision is now accepted and ready to land.Aug 11 2017, 12:21 PM
dsanders closed this revision.Aug 17 2017, 6:19 AM