[X86] Improve the type checking fast-isel handling of vector bitcasts.
authorCraig Topper <craig.topper@intel.com>
Mon, 1 Jul 2019 07:09:34 +0000 (07:09 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 1 Jul 2019 07:09:34 +0000 (07:09 +0000)
commit29fff0797b272db1c4581a30316ecbdc6676e435
treefb486e30aca7304b468a1c20c0c2de0c8a664532
parent4ca81a9b99465720d4058f435d50081c46319faf
[X86] Improve the type checking fast-isel handling of vector bitcasts.

We had a bunch of vector size legality checks for the source type
based on feature flags, but we didn't check the destination type at
all beyond ensuring that it was a "simple" type. But this allowed
the destination to be i128 which isn't legal.

This commit changes the code to use TLI's isTypeLegal logic in
place of the all the subtarget checks. Then additionally checks
that the source and dest are vectors.

Fixes 42452

llvm-svn: 364729
llvm/lib/Target/X86/X86FastISel.cpp
llvm/test/CodeGen/X86/pr42452.ll [new file with mode: 0644]