[X86][AVX] combineVectorSignBitsTruncation - avoid complex vXi64->vXi32 PACKSS trunca...
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 May 2020 10:57:25 +0000 (11:57 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 May 2020 10:57:25 +0000 (11:57 +0100)
commite53d4869a0d862934f8c74e4b74feb2b3430186a
treef8d4ba0a1b9cb39e9f9d388d37b61385d9c42f66
parent371a69ac9a146e30eb62a67bc441a60d64e62809
[X86][AVX] combineVectorSignBitsTruncation - avoid complex vXi64->vXi32 PACKSS truncations (PR45794)

Unless we're truncating an 'all-bits' result, using PACKSS for vXi64->vXi32 truncation causes problems with later combines as ComputeNumSignBits struggles to see through BITCASTs to smaller types. If we don't use PACKSS in these cases then we fallback to shuffles which are usually just as good.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/known-signbits-vector.ll
llvm/test/CodeGen/X86/min-legal-vector-width.ll