diff options
author | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-01-24 09:53:47 +0000 |
---|---|---|
committer | Sven van Haastregt <sven.vanhaastregt@arm.com> | 2018-01-24 09:53:47 +0000 |
commit | e8404780c38e44ccbbc1cd89873929ed4c49dac0 (patch) | |
tree | 09198fe18b1afe20c797e25e0741ac80e654deaa /llvm/lib/CodeGen | |
parent | 83a561584d28831a62da203cda532fe8da9cd295 (diff) | |
download | llvm-e8404780c38e44ccbbc1cd89873929ed4c49dac0.zip llvm-e8404780c38e44ccbbc1cd89873929ed4c49dac0.tar.gz llvm-e8404780c38e44ccbbc1cd89873929ed4c49dac0.tar.bz2 |
[DAGCombiner] Bail out if vector size is not a multiple
For the included test case, the DAG transformation
concat_vectors(scalar, undef) -> scalar_to_vector(sclr)
would attempt to create a v2i32 vector for a v9i8
concat_vector. Bail out to avoid creating a bitcast with
mismatching sizes later on.
Differential Revision: https://reviews.llvm.org/D42379
llvm-svn: 323312
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8cab6aa..d353dc2 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -15188,6 +15188,10 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) { if (!SclTy.isFloatingPoint() && !SclTy.isInteger()) return SDValue(); + // Bail out if the vector size is not a multiple of the scalar size. + if (VT.getSizeInBits() % SclTy.getSizeInBits()) + return SDValue(); + unsigned VNTNumElms = VT.getSizeInBits() / SclTy.getSizeInBits(); if (VNTNumElms < 2) return SDValue(); |