[DAGCombiner] Teach how to fold sext/aext/zext of constant build vectors.
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 27 Jan 2014 18:45:30 +0000 (18:45 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Mon, 27 Jan 2014 18:45:30 +0000 (18:45 +0000)
commite9c0b5aba6eefdac099dfba0a43bd4cac89fb6ff
treee24706674bfac37b502028df83680a667d69b6c3
parent0583b2c08ef5ddfa8b38370f09116295d4c45505
[DAGCombiner] Teach how to fold sext/aext/zext of constant build vectors.

This patch teaches the DAGCombiner how to fold a sext/aext/zext dag node when
the operand in input is a build vector of constants (or UNDEFs).

The inability to fold a sext/zext of a constant build_vector was the root
cause of some pcg bugs affecting vselect expansion on x86-64 with AVX support.

Before this change, the DAGCombiner only knew how to fold a sext/zext/aext of a
ConstantSDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200234 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
test/CodeGen/Mips/msa/compare_float.ll
test/CodeGen/X86/avx-blend.ll
test/CodeGen/X86/fold-vector-sext-zext.ll [new file with mode: 0644]