[InstCombine][X86] Use generic expansion of PACKSS/PACKUS for constant folding. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 24 Apr 2019 16:53:17 +0000 (16:53 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Wed, 24 Apr 2019 16:53:17 +0000 (16:53 +0000)
commit55f14dac7455e7f38286ff95431c4130e7cf3e73
tree454b69c3d07114483c1a78bd904b52cca9344f58
parent46d67fa6c5f94f15104ebecc1822687c837bb22e
[InstCombine][X86] Use generic expansion of PACKSS/PACKUS for constant folding. NFCI.

This patch rewrites the existing PACKSS/PACKUS constant folding code to expand as a generic expansion.

This is a first NFCI step toward expanding PACKSS/PACKUS intrinsics which are acting as non-saturating truncations (although technically the expansion could be used in all cases - but we'll probably want to be conservative).

llvm-svn: 359111
llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp