summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-27 19:42:58 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2019-07-27 19:42:58 +0000
commit76f2f04d9dbb95c65a64f5aa8eff0856cbe44d5f (patch)
tree6c5904e29f8068432078044e9d2469096678773e
parent791951bd32ac9af46a8c01d841912059ce8cc8cb (diff)
downloadbcm5719-llvm-76f2f04d9dbb95c65a64f5aa8eff0856cbe44d5f.tar.gz
bcm5719-llvm-76f2f04d9dbb95c65a64f5aa8eff0856cbe44d5f.zip
[DAGCombine] narrowInsertExtractVectorBinOp - early out for illegal op. NFCI.
If the subvector binop is illegal then early-out and avoid the subvector searches. llvm-svn: 367181
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 2201fc24483..4b3db73875b 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -18023,13 +18023,16 @@ static SDValue narrowInsertExtractVectorBinOp(SDNode *Extract,
SDValue Bop0 = BinOp.getOperand(0), Bop1 = BinOp.getOperand(1);
SDValue Index = Extract->getOperand(1);
EVT SubVT = Extract->getValueType(0);
+ if (!TLI.isOperationLegalOrCustom(BinOpcode, SubVT))
+ return SDValue();
+
SDValue Sub0 = getSubVectorSrc(Bop0, Index, SubVT);
SDValue Sub1 = getSubVectorSrc(Bop1, Index, SubVT);
// TODO: We could handle the case where only 1 operand is being inserted by
// creating an extract of the other operand, but that requires checking
// number of uses and/or costs.
- if (!Sub0 || !Sub1 || !TLI.isOperationLegalOrCustom(BinOpcode, SubVT))
+ if (!Sub0 || !Sub1)
return SDValue();
// We are inserting both operands of the wide binop only to extract back
OpenPOWER on IntegriCloud