diff options
author | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2013-05-06 08:06:13 +0000 |
---|---|---|
committer | Michael Kuperstein <michael.m.kuperstein@intel.com> | 2013-05-06 08:06:13 +0000 |
commit | 2720248ae5b0201a7bdba57f3625869b578f2a5d (patch) | |
tree | 3a23f207d543393796c63d67b5f492723e09f453 /lib/CodeGen/SelectionDAG | |
parent | 10c6d2c84c266ffb24ec1037e51fe79e579ecb60 (diff) | |
download | external_llvm-2720248ae5b0201a7bdba57f3625869b578f2a5d.zip external_llvm-2720248ae5b0201a7bdba57f3625869b578f2a5d.tar.gz external_llvm-2720248ae5b0201a7bdba57f3625869b578f2a5d.tar.bz2 |
Fix slightly too aggressive conact_vector optimization.
(Would sometimes optimize away conacts used to extend a vector with undef values)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 85f5df9..2e09ec0 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -9145,6 +9145,12 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) { return SDValue(); } else { SingleSource = Op.getOperand(0); + + // Check the source type is the same as the type of the result. + // If not, this concat may extend the vector, so we can not + // optimize it away. + if (SingleSource.getValueType() != N->getValueType(0)) + return SDValue(); } unsigned IdentityIndex = i * PartNumElem; |