[X86] Simplify the code at the end of lowerShuffleAsBroadcast.
authorCraig Topper <craig.topper@gmail.com>
Thu, 5 Mar 2020 04:38:44 +0000 (20:38 -0800)
committerCraig Topper <craig.topper@gmail.com>
Thu, 5 Mar 2020 04:45:02 +0000 (20:45 -0800)
commit4c7c87f245c5291ed38d47983e89d69b98660008
tree6ce7bf8623cf18bd53dd7dab21855eb960f61259
parentc64ca93053af235bac0ca4dcdcd21c8882478310
[X86] Simplify the code at the end of lowerShuffleAsBroadcast.

The original code could create a bitcast from f64 to i64 and back
on 32-bit targets. This was only working because getBitcast was
able to fold the casts away to avoid leaving the illegal i64 type.

Now we handle the scalar case directly by broadcasting using the
scalar type as the element type. Then bitcasting to the final VT.
This works since we ensure the scalar type is the same size as
the final VT element type. No more casts to i64.

For the vector case, we cast to VT or subvector of VT. And then
do the broadcast.

I think this all matches what we generated before, just in a more
readable way.
llvm/lib/Target/X86/X86ISelLowering.cpp