[X86][SelectionDAGBuilder] Move the hack for handling MMX shift by i32 intrinsics...
authorCraig Topper <craig.topper@intel.com>
Mon, 23 Sep 2019 01:05:33 +0000 (01:05 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 23 Sep 2019 01:05:33 +0000 (01:05 +0000)
commita533e87792caf3cf30f2368672b0d952a7b07786
tree79f94c3cad26290620f13ef9dbb104597cb6ca6a
parente4c17651243efb6a9f435cff06046893c91d61e0
[X86][SelectionDAGBuilder] Move the hack for handling MMX shift by i32 intrinsics into the X86 backend.

This intrinsics should be shift by immediate, but gcc allows any
i32 scalar and clang needs to match that. So we try to detect the
non-constant case and move the data from an integer register to an
MMX register.

Previously this was done by creating a v2i32 build_vector and
bitcast in SelectionDAGBuilder. This had to be done early since
v2i32 isn't a legal type. The bitcast+build_vector would be DAG
combined to X86ISD::MMX_MOVW2D which isel will turn into a
GPR->MMX MOVD.

This commit just moves the whole thing to lowering and emits
the X86ISD::MMX_MOVW2D directly to avoid the illegal type. The
test changes just seem to be due to nodes being linearized in a
different order.

llvm-svn: 372535
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/bitcast-mmx.ll
llvm/test/CodeGen/X86/mmx-fold-load.ll