summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2014-01-15 19:51:32 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2014-01-15 19:51:32 +0000
commitd7c03ec34842ad372ba3d4c49000a8f28616eeb4 (patch)
treea7b0849db16fcca9ac1fe3fdbc6ceabde24f6eda /llvm/lib/CodeGen
parent0de92d53a18f6a1e6538145d4924e843f5e3b95c (diff)
downloadbcm5719-llvm-d7c03ec34842ad372ba3d4c49000a8f28616eeb4.tar.gz
bcm5719-llvm-d7c03ec34842ad372ba3d4c49000a8f28616eeb4.zip
[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. llvm-svn: 199328
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index b0e14266bc4..0530dbc12b2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud