This is an archive of the discontinued LLVM Phabricator instance.

[X86] Immediately call LowerShift from lowerBuildVectorToBitOp.
ClosedPublic

Authored by craig.topper on Jul 8 2020, 10:34 PM.

Details

Summary

If we don't immediately lower the vector shift, the splat
constant vector we created may get turned into a constant pool
load before we get around to lowering the shift. This makes it
a lot more difficult to create a shift by constant. Sometimes we
fail to see through the constant pool at all and end up trying
to lower as if it was a variable shift. This requires custom
handling and may create an unsupported vselect on pre-sse-4.1
targets. Since we're after LegalizeVectorOps we are unable to
legalize the unsupported vselect as that code is in LegalizeDAG.

So calling LowerShift immediately ensures that we get see the
splat constant.

Fixes PR46527.

Diff Detail

Event Timeline

craig.topper created this revision.Jul 8 2020, 10:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 8 2020, 10:34 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
RKSimon accepted this revision.Jul 9 2020, 1:44 AM

LGTM - cheers

This revision is now accepted and ready to land.Jul 9 2020, 1:44 AM
This revision was automatically updated to reflect the committed changes.