diff options
author | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2014-01-15 19:51:32 +0000 |
---|---|---|
committer | Andrea Di Biagio <Andrea_DiBiagio@sn.scee.net> | 2014-01-15 19:51:32 +0000 |
commit | 3cab648f220f354db06e4334b1da3ae1f417d16e (patch) | |
tree | 36a5ecba62e6e5987c394b894c0f319aeb620a6d /lib/CodeGen/SelectionDAG | |
parent | 1fca78a9b1d78ac2e05174e8b8b0eda5fe4ab8b3 (diff) | |
download | llvm-3cab648f220f354db06e4334b1da3ae1f417d16e.tar.gz llvm-3cab648f220f354db06e4334b1da3ae1f417d16e.tar.bz2 llvm-3cab648f220f354db06e4334b1da3ae1f417d16e.tar.xz |
[DAGCombiner] Fix a wrong check in method SimplifyVBinOp.
This fixes a regression intruced by r199135.
Revision 199135 tried to simplify part of the logic in method
DAGCombiner::SimplifyVBinOp introducing calls to method BuildVectorSDNode::isConstant().
However, that revision wrongly changed the check performed by method
SimplifyVBinOp to identify dag nodes that can be folded.
Before revision 199135, that method only tried to simplify vector binary operations
if both operands were build_vector of Constant/ConstantFP/Undef only.
After revision 199135, method SimplifyVBinop tried to
simplify also vector binary operations with only one constant operand.
This fixes the problem restoring the old behavior of SimplifyVBinOp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG')
-rw-r--r-- | lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index b0e14266bc..0530dbc12b 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -10391,8 +10391,8 @@ SDValue DAGCombiner::SimplifyVBinOp(SDNode *N) { if (LHS.getOpcode() == ISD::BUILD_VECTOR && RHS.getOpcode() == ISD::BUILD_VECTOR) { // Check if both vectors are constants. If not bail out. - if (!cast<BuildVectorSDNode>(LHS)->isConstant() && - !cast<BuildVectorSDNode>(RHS)->isConstant()) + if (!(cast<BuildVectorSDNode>(LHS)->isConstant() && + cast<BuildVectorSDNode>(RHS)->isConstant())) return SDValue(); SmallVector<SDValue, 8> Ops; |