OSDN Git Service

[X86][SSE] combineVectorSignBitsTruncation - fold trunc(srl(x,c)) -> packss(sra(x,c))
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 19 Jan 2021 11:03:45 +0000 (11:03 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 19 Jan 2021 11:04:13 +0000 (11:04 +0000)
commit5626adcd6bbaadd12fe5bf15cd2d39ece2e5c406
tree889c54e44aa0df64c0ba5a66a8e96ba4dcc8c531
parent58bdfcfac048563e0dbcecc7c75e4e7897c8da18
[X86][SSE] combineVectorSignBitsTruncation - fold trunc(srl(x,c)) -> packss(sra(x,c))

If a srl doesn't introduce any sign bits into the truncated result, then replace with a sra to let us use a PACKSS truncation - fixes a regression noticed in D56387 on pre-SSE41 targets that don't have PACKUSDW.
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/vector-trunc.ll