This is an archive of the discontinued LLVM Phabricator instance.

[x86][CGP] improve sinking of splatted vector shift amount operand
ClosedPublic

Authored by spatel on May 12 2020, 4:46 PM.

Details

Summary

As-is, this conflicts with D78728, but I'm posting because we get some test diffs from using shouldSinkOperands() instead of the custom CGP code that was in optimizeShuffleVectorInst(). Assuming D78728 gets pushed first, I'll update the CGP part of this patch.

The last codegen/IR test diff shows what I suspected could happen - we were sinking all splat shift operands into a loop. But that's not what we want in general; we only want to sink the *shift amount* operand if it is a splat.

Diff Detail

Event Timeline

spatel created this revision.May 12 2020, 4:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 12 2020, 4:46 PM
RKSimon accepted this revision.May 13 2020, 6:40 AM

LGTM but please wait until D78728 has landed + rebase

This revision is now accepted and ready to land.May 13 2020, 6:40 AM
spatel updated this revision to Diff 263822.May 13 2020, 12:29 PM

Patch updated:
Rebased - I just renamed convertSplatType() since there's nothing else to do in optimizeShuffleVectorInst() now.

This revision was automatically updated to reflect the committed changes.