diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-03-16 17:36:26 +0000 | 
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2019-03-16 17:36:26 +0000 | 
| commit | 3b0a6c69ee54fbe3a873adca35fa9b282121fb3d (patch) | |
| tree | 05f62e1ebe2cd88a4a92fd948e8a7f566d40b42a /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
| parent | 6db6b56a5c8fc6dd2ab7d50d289e292a14121cd4 (diff) | |
| download | bcm5719-llvm-3b0a6c69ee54fbe3a873adca35fa9b282121fb3d.tar.gz bcm5719-llvm-3b0a6c69ee54fbe3a873adca35fa9b282121fb3d.zip | |
[DAGCombine] combineShuffleOfScalars - handle non-zero SCALAR_TO_VECTOR indices (PR41097)
rL356292 reduces the size of scalar_to_vector if we know the upper bits are undef - which means that shuffles may find they are suddenly referencing scalar_to_vector elements other than zero - so make sure we handle this as undef.
llvm-svn: 356327
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
| diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index f6363e271a1..98eb1a1bfe7 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -17596,8 +17596,8 @@ static SDValue combineShuffleOfScalars(ShuffleVectorSDNode *SVN,        if (S.getOpcode() == ISD::BUILD_VECTOR) {          Op = S.getOperand(Idx);        } else if (S.getOpcode() == ISD::SCALAR_TO_VECTOR) { -        assert(Idx == 0 && "Unexpected SCALAR_TO_VECTOR operand index."); -        Op = S.getOperand(0); +        SDValue Op0 = S.getOperand(0); +        Op = Idx == 0 ? Op0 : DAG.getUNDEF(Op0.getValueType());        } else {          // Operand can't be combined - bail out.          return SDValue(); | 

