This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Don't elide bitconverts in PatFrag fragments.
ClosedPublic

Authored by simon_tatham on Feb 14 2020, 9:06 AM.

Details

Summary

In the DAG pattern backend, SimplifyTree simplifies a pattern by
removing bitconverts between two identical types. But that function is
also run on the fragments list in instances of PatFrags, in which
the types haven't been specified yet. So the input and output of the
bitconvert always evaluate to the empty set of types, which makes them
compare equal. So the test always passes, and bitconverts are
unconditionally removed from the PatFrag RHS.

Fixed by spotting the empty type set and using it to inhibit the
optimization.

Event Timeline

simon_tatham created this revision.Feb 14 2020, 9:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2020, 9:06 AM
nhaehnle accepted this revision.Feb 16 2020, 9:47 AM

I'm not too familiar with this part of the code, but the logic makes sense to me.

This revision is now accepted and ready to land.Feb 16 2020, 9:47 AM
This revision was automatically updated to reflect the committed changes.