This is an archive of the discontinued LLVM Phabricator instance.

GlobalISel: Move fconstant matching into tablegen
ClosedPublic

Authored by arsenm on May 9 2023, 6:00 AM.

Details

Summary

I don't really understand what the point of wip_match_opcode is.
It doesn't seem to have any purpose other than to list opcodes
to have all the logic in pure C++. You can't seem to use it to
select multiple opcodes in the same way you use match.

Something is wrong with it, since the match emitter prints
"errors" if an opcode is covered by wip_match_opcode and
then appears in another pattern. For exmaple with this patch,
you see this several times in the build:

  
error: Leaf constant_fold_fabs is unreachable
note: Leaf idempotent_prop will have already matched

The combines are actually produced and the tests for them
do pass, so this seems to just be a broken warning.

Diff Detail

Event Timeline

arsenm created this revision.May 9 2023, 6:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 6:00 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
arsenm requested review of this revision.May 9 2023, 6:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 6:00 AM
Herald added a subscriber: wdng. · View Herald Transcript
arsenm added a reviewer: Kai.May 9 2023, 6:35 AM
aemerson accepted this revision.May 9 2023, 9:46 AM

LGTM.

This revision is now accepted and ready to land.May 9 2023, 9:46 AM
foad added a subscriber: foad.May 20 2023, 6:09 AM