OSDN Git Service

[X86] Immediately call LowerShift from lowerBuildVectorToBitOp.
authorCraig Topper <craig.topper@intel.com>
Thu, 9 Jul 2020 17:41:03 +0000 (10:41 -0700)
committerCraig Topper <craig.topper@intel.com>
Thu, 9 Jul 2020 17:51:29 +0000 (10:51 -0700)
commit918e6531863187d65895fd68bbc622369b3d79f3
tree5f3da60483698cf1d308783ac0577713f5e5044f
parent8769611f0af2598177d8d03ad6dbbe064210bfed
[X86] Immediately call LowerShift from lowerBuildVectorToBitOp.

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 LegalizeVectorOps
rather than LegalizeDAG.

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

Fixes PR46527.

Differential Revision: https://reviews.llvm.org/D83455
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/pr46527.ll [new file with mode: 0644]