summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2015-04-16 00:56:20 +0000
committerNick Lewycky <nicholas@mxc.ca>2015-04-16 00:56:20 +0000
commitb8557a972f31522666629bd389ab54c8518b85bb (patch)
tree7ca61d603fa81c7a9bd5ee2b00b145bb6baa4a98 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
parent8676214025efa617bf8e6fb6855c63ba74e277a8 (diff)
downloadbcm5719-llvm-b8557a972f31522666629bd389ab54c8518b85bb.tar.gz
bcm5719-llvm-b8557a972f31522666629bd389ab54c8518b85bb.zip
Revert r234809 because it caused PR23246.
llvm-svn: 235062
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 42df21bce34..14449502ee2 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -11499,62 +11499,6 @@ SDValue DAGCombiner::visitBUILD_VECTOR(SDNode *N) {
return SDValue();
}
-static SDValue combineConcatVectorOfScalars(SDNode *N, SelectionDAG &DAG) {
- const TargetLowering &TLI = DAG.getTargetLoweringInfo();
- EVT OpVT = N->getOperand(0).getValueType();
-
- // If the operands are legal vectors, leave them alone.
- if (TLI.isTypeLegal(OpVT))
- return SDValue();
-
- SDLoc DL(N);
- EVT VT = N->getValueType(0);
- SmallVector<SDValue, 8> Ops;
-
- EVT SVT = EVT::getIntegerVT(*DAG.getContext(), OpVT.getSizeInBits());
- SDValue ScalarUndef = DAG.getNode(ISD::UNDEF, DL, SVT);
-
- // Keep track of what we encounter.
- bool AnyInteger = false;
- bool AnyFP = false;
- for (const SDValue &Op : N->ops()) {
- if (ISD::BITCAST == Op.getOpcode() &&
- !Op.getOperand(0).getValueType().isVector())
- Ops.push_back(Op.getOperand(0));
- else if (ISD::UNDEF == Op.getOpcode())
- Ops.push_back(ScalarUndef);
- else
- return SDValue();
-
- if (Ops.back().getValueType().isFloatingPoint())
- AnyFP = true;
- else
- AnyInteger = true;
- }
-
- // If any of the operands is a floating point scalar bitcast to a vector,
- // use floating point types throughout, and bitcast everything.
- // Replace UNDEFs by another scalar UNDEF node, of the final desired type.
- if (AnyFP) {
- SVT = EVT::getFloatingPointVT(OpVT.getSizeInBits());
- ScalarUndef = DAG.getNode(ISD::UNDEF, DL, SVT);
- if (AnyInteger) {
- for (SDValue &Op : Ops) {
- if (Op.getValueType() != SVT) {
- Op = DAG.getNode(ISD::BITCAST, DL, SVT, Op);
- if (Op.getOpcode() == ISD::UNDEF)
- Op = ScalarUndef;
- }
- }
- }
- }
-
- EVT VecVT = EVT::getVectorVT(*DAG.getContext(), SVT,
- VT.getSizeInBits() / SVT.getSizeInBits());
- return DAG.getNode(ISD::BITCAST, DL, VT,
- DAG.getNode(ISD::BUILD_VECTOR, DL, VecVT, Ops));
-}
-
SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
// TODO: Check to see if this is a CONCAT_VECTORS of a bunch of
// EXTRACT_SUBVECTOR operations. If so, and if the EXTRACT_SUBVECTOR vector
@@ -11657,10 +11601,6 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(N), VT, Opnds);
}
- // Fold CONCAT_VECTORS of only bitcast scalars (or undef) to BUILD_VECTOR.
- if (SDValue V = combineConcatVectorOfScalars(N, DAG))
- return V;
-
// Type legalization of vectors and DAG canonicalization of SHUFFLE_VECTOR
// nodes often generate nop CONCAT_VECTOR nodes.
// Scan the CONCAT_VECTOR operands and look for a CONCAT operations that
OpenPOWER on IntegriCloud