This is an archive of the discontinued LLVM Phabricator instance.

TableGen/GlobalISel: Make address space/align predicates consistent
ClosedPublic

Authored by arsenm on Apr 5 2022, 9:37 AM.

Details

Summary

The builtin predicate handling has a strange behavior where the code
assumes that a PatFrag is a stack of PatFrags, and each level adds at
most one predicate. I don't think this particularly makes sense,
especially without a diagnostic to ensure you aren't trying to set
multiple at once.

This wasn't followed for address spaces and alignment, which could
potentially fall through to report no builtin predicate was
added. Just switch these to follow the existing convention for now.

Diff Detail

Event Timeline

arsenm created this revision.Apr 5 2022, 9:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 9:37 AM
arsenm requested review of this revision.Apr 5 2022, 9:37 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 5 2022, 9:37 AM
Herald added a subscriber: wdng. · View Herald Transcript

See also discussion on D83034.

The problem is really the GlobalISel path doesn't have the equivalent checking done in TreePredicateFn::getPredCode(). I think the path of least resistance is to conform to the restrictions that enforces, and then start enforcing the same ones here

This revision is now accepted and ready to land.Apr 22 2022, 10:23 AM