This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Move d16 load matching to preprocess step
ClosedPublic

Authored by arsenm on Mar 8 2019, 8:26 AM.

Details

Summary

When matching half of the build_vector to a load, there could still be
a hidden dependency on the other half of the build_vector the pattern
wouldn't detect. If there was an additional chain dependency on the
other value, a cycle could be introduced.

I don't think a tablegen pattern is capable of matching the necessary
conditions, so move this into PreprocessISelDAG. Check isPredecessorOf
for the other value to avoid a cycle. This has a warning that it's
expensive, so this should probably be moved into an MI pass eventually
that will have more freedom to reorder instructions to help match
this. That is currently complicated by the lack of a computeKnownBits
type mechanism for the selected function.

Diff Detail

Event Timeline

arsenm created this revision.Mar 8 2019, 8:26 AM
This revision is now accepted and ready to land.Mar 8 2019, 11:27 AM
arsenm closed this revision.Mar 8 2019, 12:57 PM

r355731