summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2020-01-04 17:03:33 -0800
committerCraig Topper <craig.topper@gmail.com>2020-01-04 17:03:50 -0800
commit285d5e6b8b1ecc70c25468b6c7458d2adadeddf3 (patch)
tree4c756df5eac11a103d0bb8c95a69affa59b68ac5
parent085898d469ab782f0a26f119b109aa8eb5d37745 (diff)
downloadbcm5719-llvm-285d5e6b8b1ecc70c25468b6c7458d2adadeddf3.tar.gz
bcm5719-llvm-285d5e6b8b1ecc70c25468b6c7458d2adadeddf3.zip
[LegalizeVectorOps] Split most of ExpandStrictFPOp into a separate UnrollStrictFPOp method. Call that method from ExpandUINT_TO_FLOAT.
ExpandStrictFPOp calls ExpandUINT_TO_FLOAT. Previously, ExpandUINT_TO_FLOAT returned SDValue() if it wasn't able to handle and needed to unroll. Then ExpandStrictFPOp would detect his SDValue() and do the unroll. After this change, ExpandUINT_TO_FLOAT will directly call UnrollStrictFPOp and return the unrolled result.
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
index c4287b09780..4127feda0e8 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
@@ -148,6 +148,8 @@ class VectorLegalizer {
SDValue ExpandFixedPointMul(SDValue Op);
SDValue ExpandStrictFPOp(SDValue Op);
+ SDValue UnrollStrictFPOp(SDValue Op);
+
/// Implements vector promotion.
///
/// This is essentially just bitcasting the operands to a different type and
@@ -1208,8 +1210,11 @@ SDValue VectorLegalizer::ExpandUINT_TO_FLOAT(SDValue Op) {
TargetLowering::Expand) ||
(IsStrict && TLI.getOperationAction(ISD::STRICT_SINT_TO_FP, VT) ==
TargetLowering::Expand)) ||
- TLI.getOperationAction(ISD::SRL, VT) == TargetLowering::Expand)
- return IsStrict ? SDValue() : DAG.UnrollVectorOp(Op.getNode());
+ TLI.getOperationAction(ISD::SRL, VT) == TargetLowering::Expand) {
+ if (IsStrict)
+ return UnrollStrictFPOp(Op);
+ return DAG.UnrollVectorOp(Op.getNode());
+ }
unsigned BW = VT.getScalarSizeInBits();
assert((BW == 64 || BW == 32) &&
@@ -1386,11 +1391,13 @@ SDValue VectorLegalizer::ExpandFixedPointMul(SDValue Op) {
}
SDValue VectorLegalizer::ExpandStrictFPOp(SDValue Op) {
- if (Op.getOpcode() == ISD::STRICT_UINT_TO_FP) {
- if (SDValue Res = ExpandUINT_TO_FLOAT(Op))
- return Res;
- }
+ if (Op.getOpcode() == ISD::STRICT_UINT_TO_FP)
+ return ExpandUINT_TO_FLOAT(Op);
+
+ return UnrollStrictFPOp(Op);
+}
+SDValue VectorLegalizer::UnrollStrictFPOp(SDValue Op) {
EVT VT = Op.getValue(0).getValueType();
EVT EltVT = VT.getVectorElementType();
unsigned NumElems = VT.getVectorNumElements();
OpenPOWER on IntegriCloud