This is an archive of the discontinued LLVM Phabricator instance.

[X86] Change avx512 COMPRESS and EXPAND lowering to use a single masked node instead of expand/compress+select.
ClosedPublic

Authored by craig.topper on Jan 21 2019, 1:24 AM.

Details

Summary

For compress, a select node doesn't semantically reflect the behavior of the instruction. The mask would have holes in it, but the resulting write is to contiguous elements at the bottom of the vector.

Furthermore, as far as the compressing and expanding is concerned the behavior is depended on the mask. You can't just have an expand/compress node that only reads the input vector. That node would have no meaning by itself.

This all only works because we pattern match the compress/expand+select back to the instruction. But conceivably an optimization of the select could break the pattern and leave something meaningless.

This patch modifies the expand and compress node to take the mask and passthru as additional inputs and gets rid of the select all together.

Diff Detail

Repository
rL LLVM

Event Timeline

craig.topper created this revision.Jan 21 2019, 1:24 AM
RKSimon accepted this revision.Jan 21 2019, 6:56 AM

LGTM

This revision is now accepted and ready to land.Jan 21 2019, 6:56 AM
craig.topper edited the summary of this revision. (Show Details)Jan 21 2019, 11:24 AM
This revision was automatically updated to reflect the committed changes.