[llvm] [Legalizer] Soften EXTRACT_ELEMENT on ppcf128 (PR #77412)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 21:42:19 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff c7cae61b289fd12171a2da80a6e90b867ee1c4fc 87e1d4acdd87d45f265e590ad135e21f352dc5ad -- llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
index 69759a7d64..d9ff591181 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
@@ -60,105 +60,200 @@ void DAGTypeLegalizer::SoftenFloatResult(SDNode *N, unsigned ResNo) {
#endif
report_fatal_error("Do not know how to soften the result of this "
"operator!");
- case ISD::EXTRACT_ELEMENT:
- R = SoftenFloatRes_EXTRACT_ELEMENT(N);
- break;
- case ISD::ARITH_FENCE: R = SoftenFloatRes_ARITH_FENCE(N); break;
- case ISD::MERGE_VALUES:R = SoftenFloatRes_MERGE_VALUES(N, ResNo); break;
- case ISD::BITCAST: R = SoftenFloatRes_BITCAST(N); break;
- case ISD::BUILD_PAIR: R = SoftenFloatRes_BUILD_PAIR(N); break;
- case ISD::ConstantFP: R = SoftenFloatRes_ConstantFP(N); break;
- case ISD::EXTRACT_VECTOR_ELT:
- R = SoftenFloatRes_EXTRACT_VECTOR_ELT(N, ResNo); break;
- case ISD::FABS: R = SoftenFloatRes_FABS(N); break;
- case ISD::STRICT_FMINNUM:
- case ISD::FMINNUM: R = SoftenFloatRes_FMINNUM(N); break;
- case ISD::STRICT_FMAXNUM:
- case ISD::FMAXNUM: R = SoftenFloatRes_FMAXNUM(N); break;
- case ISD::STRICT_FADD:
- case ISD::FADD: R = SoftenFloatRes_FADD(N); break;
- case ISD::FCBRT: R = SoftenFloatRes_FCBRT(N); break;
- case ISD::STRICT_FCEIL:
- case ISD::FCEIL: R = SoftenFloatRes_FCEIL(N); break;
- case ISD::FCOPYSIGN: R = SoftenFloatRes_FCOPYSIGN(N); break;
- case ISD::STRICT_FCOS:
- case ISD::FCOS: R = SoftenFloatRes_FCOS(N); break;
- case ISD::STRICT_FDIV:
- case ISD::FDIV: R = SoftenFloatRes_FDIV(N); break;
- case ISD::STRICT_FEXP:
- case ISD::FEXP: R = SoftenFloatRes_FEXP(N); break;
- case ISD::STRICT_FEXP2:
- case ISD::FEXP2: R = SoftenFloatRes_FEXP2(N); break;
- case ISD::FEXP10: R = SoftenFloatRes_FEXP10(N); break;
- case ISD::STRICT_FFLOOR:
- case ISD::FFLOOR: R = SoftenFloatRes_FFLOOR(N); break;
- case ISD::STRICT_FLOG:
- case ISD::FLOG: R = SoftenFloatRes_FLOG(N); break;
- case ISD::STRICT_FLOG2:
- case ISD::FLOG2: R = SoftenFloatRes_FLOG2(N); break;
- case ISD::STRICT_FLOG10:
- case ISD::FLOG10: R = SoftenFloatRes_FLOG10(N); break;
- case ISD::STRICT_FMA:
- case ISD::FMA: R = SoftenFloatRes_FMA(N); break;
- case ISD::STRICT_FMUL:
- case ISD::FMUL: R = SoftenFloatRes_FMUL(N); break;
- case ISD::STRICT_FNEARBYINT:
- case ISD::FNEARBYINT: R = SoftenFloatRes_FNEARBYINT(N); break;
- case ISD::FNEG: R = SoftenFloatRes_FNEG(N); break;
- case ISD::STRICT_FP_EXTEND:
- case ISD::FP_EXTEND: R = SoftenFloatRes_FP_EXTEND(N); break;
- case ISD::STRICT_FP_ROUND:
- case ISD::FP_ROUND: R = SoftenFloatRes_FP_ROUND(N); break;
- case ISD::FP16_TO_FP: R = SoftenFloatRes_FP16_TO_FP(N); break;
- case ISD::BF16_TO_FP: R = SoftenFloatRes_BF16_TO_FP(N); break;
- case ISD::STRICT_FPOW:
- case ISD::FPOW: R = SoftenFloatRes_FPOW(N); break;
- case ISD::STRICT_FPOWI:
- case ISD::FPOWI:
- case ISD::FLDEXP:
- case ISD::STRICT_FLDEXP: R = SoftenFloatRes_ExpOp(N); break;
- case ISD::FFREXP:
- R = SoftenFloatRes_FFREXP(N);
- break;
- case ISD::STRICT_FREM:
- case ISD::FREM: R = SoftenFloatRes_FREM(N); break;
- case ISD::STRICT_FRINT:
- case ISD::FRINT: R = SoftenFloatRes_FRINT(N); break;
- case ISD::STRICT_FROUND:
- case ISD::FROUND: R = SoftenFloatRes_FROUND(N); break;
- case ISD::STRICT_FROUNDEVEN:
- case ISD::FROUNDEVEN: R = SoftenFloatRes_FROUNDEVEN(N); break;
- case ISD::STRICT_FSIN:
- case ISD::FSIN: R = SoftenFloatRes_FSIN(N); break;
- case ISD::STRICT_FSQRT:
- case ISD::FSQRT: R = SoftenFloatRes_FSQRT(N); break;
- case ISD::STRICT_FSUB:
- case ISD::FSUB: R = SoftenFloatRes_FSUB(N); break;
- case ISD::STRICT_FTRUNC:
- case ISD::FTRUNC: R = SoftenFloatRes_FTRUNC(N); break;
- case ISD::LOAD: R = SoftenFloatRes_LOAD(N); break;
- case ISD::ATOMIC_SWAP: R = BitcastToInt_ATOMIC_SWAP(N); break;
- case ISD::SELECT: R = SoftenFloatRes_SELECT(N); break;
- case ISD::SELECT_CC: R = SoftenFloatRes_SELECT_CC(N); break;
- case ISD::FREEZE: R = SoftenFloatRes_FREEZE(N); break;
- case ISD::STRICT_SINT_TO_FP:
- case ISD::STRICT_UINT_TO_FP:
- case ISD::SINT_TO_FP:
- case ISD::UINT_TO_FP: R = SoftenFloatRes_XINT_TO_FP(N); break;
- case ISD::UNDEF: R = SoftenFloatRes_UNDEF(N); break;
- case ISD::VAARG: R = SoftenFloatRes_VAARG(N); break;
- case ISD::VECREDUCE_FADD:
- case ISD::VECREDUCE_FMUL:
- case ISD::VECREDUCE_FMIN:
- case ISD::VECREDUCE_FMAX:
- case ISD::VECREDUCE_FMAXIMUM:
- case ISD::VECREDUCE_FMINIMUM:
- R = SoftenFloatRes_VECREDUCE(N);
- break;
- case ISD::VECREDUCE_SEQ_FADD:
- case ISD::VECREDUCE_SEQ_FMUL:
- R = SoftenFloatRes_VECREDUCE_SEQ(N);
- break;
+ case ISD::EXTRACT_ELEMENT:
+ R = SoftenFloatRes_EXTRACT_ELEMENT(N);
+ break;
+ case ISD::ARITH_FENCE:
+ R = SoftenFloatRes_ARITH_FENCE(N);
+ break;
+ case ISD::MERGE_VALUES:
+ R = SoftenFloatRes_MERGE_VALUES(N, ResNo);
+ break;
+ case ISD::BITCAST:
+ R = SoftenFloatRes_BITCAST(N);
+ break;
+ case ISD::BUILD_PAIR:
+ R = SoftenFloatRes_BUILD_PAIR(N);
+ break;
+ case ISD::ConstantFP:
+ R = SoftenFloatRes_ConstantFP(N);
+ break;
+ case ISD::EXTRACT_VECTOR_ELT:
+ R = SoftenFloatRes_EXTRACT_VECTOR_ELT(N, ResNo);
+ break;
+ case ISD::FABS:
+ R = SoftenFloatRes_FABS(N);
+ break;
+ case ISD::STRICT_FMINNUM:
+ case ISD::FMINNUM:
+ R = SoftenFloatRes_FMINNUM(N);
+ break;
+ case ISD::STRICT_FMAXNUM:
+ case ISD::FMAXNUM:
+ R = SoftenFloatRes_FMAXNUM(N);
+ break;
+ case ISD::STRICT_FADD:
+ case ISD::FADD:
+ R = SoftenFloatRes_FADD(N);
+ break;
+ case ISD::FCBRT:
+ R = SoftenFloatRes_FCBRT(N);
+ break;
+ case ISD::STRICT_FCEIL:
+ case ISD::FCEIL:
+ R = SoftenFloatRes_FCEIL(N);
+ break;
+ case ISD::FCOPYSIGN:
+ R = SoftenFloatRes_FCOPYSIGN(N);
+ break;
+ case ISD::STRICT_FCOS:
+ case ISD::FCOS:
+ R = SoftenFloatRes_FCOS(N);
+ break;
+ case ISD::STRICT_FDIV:
+ case ISD::FDIV:
+ R = SoftenFloatRes_FDIV(N);
+ break;
+ case ISD::STRICT_FEXP:
+ case ISD::FEXP:
+ R = SoftenFloatRes_FEXP(N);
+ break;
+ case ISD::STRICT_FEXP2:
+ case ISD::FEXP2:
+ R = SoftenFloatRes_FEXP2(N);
+ break;
+ case ISD::FEXP10:
+ R = SoftenFloatRes_FEXP10(N);
+ break;
+ case ISD::STRICT_FFLOOR:
+ case ISD::FFLOOR:
+ R = SoftenFloatRes_FFLOOR(N);
+ break;
+ case ISD::STRICT_FLOG:
+ case ISD::FLOG:
+ R = SoftenFloatRes_FLOG(N);
+ break;
+ case ISD::STRICT_FLOG2:
+ case ISD::FLOG2:
+ R = SoftenFloatRes_FLOG2(N);
+ break;
+ case ISD::STRICT_FLOG10:
+ case ISD::FLOG10:
+ R = SoftenFloatRes_FLOG10(N);
+ break;
+ case ISD::STRICT_FMA:
+ case ISD::FMA:
+ R = SoftenFloatRes_FMA(N);
+ break;
+ case ISD::STRICT_FMUL:
+ case ISD::FMUL:
+ R = SoftenFloatRes_FMUL(N);
+ break;
+ case ISD::STRICT_FNEARBYINT:
+ case ISD::FNEARBYINT:
+ R = SoftenFloatRes_FNEARBYINT(N);
+ break;
+ case ISD::FNEG:
+ R = SoftenFloatRes_FNEG(N);
+ break;
+ case ISD::STRICT_FP_EXTEND:
+ case ISD::FP_EXTEND:
+ R = SoftenFloatRes_FP_EXTEND(N);
+ break;
+ case ISD::STRICT_FP_ROUND:
+ case ISD::FP_ROUND:
+ R = SoftenFloatRes_FP_ROUND(N);
+ break;
+ case ISD::FP16_TO_FP:
+ R = SoftenFloatRes_FP16_TO_FP(N);
+ break;
+ case ISD::BF16_TO_FP:
+ R = SoftenFloatRes_BF16_TO_FP(N);
+ break;
+ case ISD::STRICT_FPOW:
+ case ISD::FPOW:
+ R = SoftenFloatRes_FPOW(N);
+ break;
+ case ISD::STRICT_FPOWI:
+ case ISD::FPOWI:
+ case ISD::FLDEXP:
+ case ISD::STRICT_FLDEXP:
+ R = SoftenFloatRes_ExpOp(N);
+ break;
+ case ISD::FFREXP:
+ R = SoftenFloatRes_FFREXP(N);
+ break;
+ case ISD::STRICT_FREM:
+ case ISD::FREM:
+ R = SoftenFloatRes_FREM(N);
+ break;
+ case ISD::STRICT_FRINT:
+ case ISD::FRINT:
+ R = SoftenFloatRes_FRINT(N);
+ break;
+ case ISD::STRICT_FROUND:
+ case ISD::FROUND:
+ R = SoftenFloatRes_FROUND(N);
+ break;
+ case ISD::STRICT_FROUNDEVEN:
+ case ISD::FROUNDEVEN:
+ R = SoftenFloatRes_FROUNDEVEN(N);
+ break;
+ case ISD::STRICT_FSIN:
+ case ISD::FSIN:
+ R = SoftenFloatRes_FSIN(N);
+ break;
+ case ISD::STRICT_FSQRT:
+ case ISD::FSQRT:
+ R = SoftenFloatRes_FSQRT(N);
+ break;
+ case ISD::STRICT_FSUB:
+ case ISD::FSUB:
+ R = SoftenFloatRes_FSUB(N);
+ break;
+ case ISD::STRICT_FTRUNC:
+ case ISD::FTRUNC:
+ R = SoftenFloatRes_FTRUNC(N);
+ break;
+ case ISD::LOAD:
+ R = SoftenFloatRes_LOAD(N);
+ break;
+ case ISD::ATOMIC_SWAP:
+ R = BitcastToInt_ATOMIC_SWAP(N);
+ break;
+ case ISD::SELECT:
+ R = SoftenFloatRes_SELECT(N);
+ break;
+ case ISD::SELECT_CC:
+ R = SoftenFloatRes_SELECT_CC(N);
+ break;
+ case ISD::FREEZE:
+ R = SoftenFloatRes_FREEZE(N);
+ break;
+ case ISD::STRICT_SINT_TO_FP:
+ case ISD::STRICT_UINT_TO_FP:
+ case ISD::SINT_TO_FP:
+ case ISD::UINT_TO_FP:
+ R = SoftenFloatRes_XINT_TO_FP(N);
+ break;
+ case ISD::UNDEF:
+ R = SoftenFloatRes_UNDEF(N);
+ break;
+ case ISD::VAARG:
+ R = SoftenFloatRes_VAARG(N);
+ break;
+ case ISD::VECREDUCE_FADD:
+ case ISD::VECREDUCE_FMUL:
+ case ISD::VECREDUCE_FMIN:
+ case ISD::VECREDUCE_FMAX:
+ case ISD::VECREDUCE_FMAXIMUM:
+ case ISD::VECREDUCE_FMINIMUM:
+ R = SoftenFloatRes_VECREDUCE(N);
+ break;
+ case ISD::VECREDUCE_SEQ_FADD:
+ case ISD::VECREDUCE_SEQ_FMUL:
+ R = SoftenFloatRes_VECREDUCE_SEQ(N);
+ break;
}
// If R is null, the sub-method took care of registering the result.
@@ -270,8 +365,8 @@ SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_ELEMENT(SDNode *N) {
Src.getOperand(0)->getOpcode() == ISD::BUILD_PAIR &&
"In floats only ppcf128 can be extracted by element!");
EVT DestVT = EVT::getIntegerVT(*DAG.getContext(), N->getValueSizeInBits(0));
- return DAG.getNode(ISD::EXTRACT_ELEMENT, SDLoc(N), DestVT,
- Src.getOperand(0), N->getOperand(1));
+ return DAG.getNode(ISD::EXTRACT_ELEMENT, SDLoc(N), DestVT, Src.getOperand(0),
+ N->getOperand(1));
}
SDValue DAGTypeLegalizer::SoftenFloatRes_EXTRACT_VECTOR_ELT(SDNode *N, unsigned ResNo) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/77412
More information about the llvm-commits
mailing list