diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-03-17 18:58:01 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2014-03-17 18:58:01 +0000 |
commit | 985b9de4856b37489de54cfa7054ee36a2464d34 (patch) | |
tree | 07e04c9ac0768b442c5b235301212c80cb4108bd /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 76c82037bb9e9a3a2dafaf8478dd42cc54206f23 (diff) | |
download | bcm5719-llvm-985b9de4856b37489de54cfa7054ee36a2464d34.tar.gz bcm5719-llvm-985b9de4856b37489de54cfa7054ee36a2464d34.zip |
Make DAGCombiner work on vector bitshifts with constant splat vectors.
llvm-svn: 204071
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 43a02fe9c7e..df8d423ab22 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6573,6 +6573,19 @@ bool BuildVectorSDNode::isConstantSplat(APInt &SplatValue, return true; } +ConstantSDNode *BuildVectorSDNode::isConstantSplat() const { + SDValue Op0 = getOperand(0); + for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { + SDValue Opi = getOperand(i); + unsigned Opc = Opi.getOpcode(); + if ((Opc != ISD::UNDEF && Opc != ISD::Constant && Opc != ISD::ConstantFP) || + Opi != Op0) + return nullptr; + } + + return cast<ConstantSDNode>(Op0); +} + bool BuildVectorSDNode::isConstant() const { for (unsigned i = 0, e = getNumOperands(); i != e; ++i) { unsigned Opc = getOperand(i).getOpcode(); |