[X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTrunca...
authorCraig Topper <craig.topper@sifive.com>
Wed, 9 Jun 2021 14:08:16 +0000 (07:08 -0700)
committerCraig Topper <craig.topper@sifive.com>
Wed, 9 Jun 2021 14:08:17 +0000 (07:08 -0700)
commit765ef4bb2af604ea2bbd6c1bffaa6e1600804c9e
tree6f2bb5f0847db5d1b45532579e93c7f29652bfc9
parentdd763ac79196b3d3bc0370b9dbd35e0c083e52a4
[X86] Check destination element type before forming VTRUNCS/VTRUNCUS in combineTruncateWithSat.

Fixes crash reported here https://reviews.llvm.org/D73607

Using a store to keep the trunc intact. Returning v16i24 would
cause the trunc to be optimized away in SelectionDAGBuilder.

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D103940
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-trunc-ssat.ll