This is an archive of the discontinued LLVM Phabricator instance.

[X86] Don't form masked instructions if the operation has an additional user.
ClosedPublic

Authored by craig.topper on Apr 20 2019, 11:28 PM.

Details

Summary

This will cause the operation to be repeated in both a mask and another masked
or unmasked form. This can a wasted of execution resources.

Unfortunately, a lot of our intrinsic test both masked and unmasked operations
with the same inputs and we now emit the op part only once. I'll try to clean
this up, but wanted to get feedback on the patch itself first.

Event Timeline

craig.topper created this revision.Apr 20 2019, 11:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2019, 11:28 PM
Herald added a subscriber: hiraditya. · View Herald Transcript

If we are happy with the assumption that a masked move is always as cheap or cheaper than any other masked op (we may want to explicitly state that at the vselect_mask def at the top of X86InstrAVX512.td), I think this makes sense but I don't envy the job of fixing all these tests and adding more relevant ones.......

Rebase. I'm going to try to work on the tests or maybe just start blacklisting instructions until we get the tests fixed.

Black list instructions that are currently failing tests.

Rebase now that I fixed most of the tests to avoid the blacklist

Add one use check for scalars as well

RKSimon accepted this revision.Mar 27 2020, 5:40 AM

LGTM with a few typo corrections

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
727 ↗(On Diff #252907)

typo?

734 ↗(On Diff #252907)

operation

735 ↗(On Diff #252907)

preven?

This revision is now accepted and ready to land.Mar 27 2020, 5:40 AM
This revision was automatically updated to reflect the committed changes.