[X86] combineBitcastvxi1 - don't prematurely create PACKSS nodes.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 21 Jul 2023 18:10:06 +0000 (19:10 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 21 Jul 2023 18:10:18 +0000 (19:10 +0100)
commit65c9153cf055d398a224adcbfdddf23059b433d1
tree40bdaefce78cca8694de7d978fc71e11885ac81a
parentc6c5aad6a24311e855b6ab7054b861a0a066e08c
[X86] combineBitcastvxi1 - don't prematurely create PACKSS nodes.

Similar to Issue #63710 - by truncating the v8i16 result with a PACKSS node before type legalization, we fail to make use of various folds that rely on TRUNCATE nodes.

This required tweaks to LowerTruncateVecPackWithSignBits to recognise when the truncation source has been widened and to more closely match combineVectorSignBitsTruncation wrt truncating with PACKSS/PACKUS on AVX512 targets.

One of the last stages before we can finally get rid of combineVectorSignBitsTruncation.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-reduce-and-bool.ll