Skip to content

Commit

Permalink
[SelectionDAG] remove redundant code; NFCI
Browse files Browse the repository at this point in the history
getNode() squashes concatenation of undefs via FoldCONCAT_VECTORS():
  // Concat of UNDEFs is UNDEF.
  if (llvm::all_of(Ops, [](SDValue Op) { return Op.isUndef(); }))
    return DAG.getUNDEF(VT);

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@361284 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
rotateright committed May 21, 2019
1 parent d0b0750 commit 0255013
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3637,12 +3637,8 @@ void SelectionDAGBuilder::visitShuffleVector(const User &I) {
MOps1[0] = Src1;
MOps2[0] = Src2;

Src1 = Src1.isUndef()
? DAG.getUNDEF(PaddedVT)
: DAG.getNode(ISD::CONCAT_VECTORS, DL, PaddedVT, MOps1);
Src2 = Src2.isUndef()
? DAG.getUNDEF(PaddedVT)
: DAG.getNode(ISD::CONCAT_VECTORS, DL, PaddedVT, MOps2);
Src1 = DAG.getNode(ISD::CONCAT_VECTORS, DL, PaddedVT, MOps1);
Src2 = DAG.getNode(ISD::CONCAT_VECTORS, DL, PaddedVT, MOps2);

// Readjust mask for new input vector length.
SmallVector<int, 8> MappedOps(PaddedMaskNumElts, -1);
Expand Down

0 comments on commit 0255013

Please sign in to comment.