This is an archive of the discontinued LLVM Phabricator instance.

[DAG] Enable ISD::EXTRACT_SUBVECTOR SimplifyMultipleUseDemandedBits handling
ClosedPublic

Authored by RKSimon on Jan 20 2020, 3:17 AM.

Details

Summary

This allows SimplifyDemandedBits to call SimplifyMultipleUseDemandedBits to create a simpler ISD::EXTRACT_SUBVECTOR, which is particularly useful for cases where we're splitting into subvectors anyhow.

Diff Detail

Event Timeline

RKSimon created this revision.Jan 20 2020, 3:17 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2020, 3:17 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
spatel added inline comments.Jan 23 2020, 10:20 AM
llvm/test/CodeGen/X86/pr31956.ll
14

Looked at this a bit, and I think this is ok. We are intentionally being aggressive about duplicating multi-use loads because eliminating the dependency and reducing register pressure (assuming load-folding) is probably better for perf if this code is in a loop.

In this particular case, there seems to be an opportunity to commute the shufps masks in lowerShuffleWithSHUFPS() in the case where we create 2 shufps ops. I'm guessing that's a very rare occurrence, so not sure if it's worth a TODO comment/bug report.

RKSimon marked an inline comment as done.Jan 23 2020, 12:21 PM
RKSimon added inline comments.
llvm/test/CodeGen/X86/pr31956.ll
14

That shouldn't be a problem, I'll deal with that first.

RKSimon edited the summary of this revision. (Show Details)Jan 24 2020, 10:38 AM

any more comments?

spatel accepted this revision.Jan 27 2020, 9:23 AM

LGTM

This revision is now accepted and ready to land.Jan 27 2020, 9:23 AM