[PATCH] D92473: [Legalizer] Promote result type in expanding FP_TO_XINT
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 2 13:14:36 PST 2020
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:913
+// If the result is not legal, eg: fp -> i1, then it needs to be promoted to
+// a larger type, eg: fp -> i32. Even if it is legal, no libcall may exactly
----------------
If the type isn't legal, it would have already been handled by LegalizeIntegerTypes.cpp since results are checked for legality first.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:947
RTLIB::Libcall LC = RTLIB::UNKNOWN_LIBCALL;
- for (unsigned IntVT = MVT::FIRST_INTEGER_VALUETYPE;
- IntVT <= MVT::LAST_INTEGER_VALUETYPE && LC == RTLIB::UNKNOWN_LIBCALL;
- ++IntVT) {
- NVT = (MVT::SimpleValueType)IntVT;
- // The type needs to big enough to hold the result.
- if (NVT.bitsGE(RVT))
- LC = Signed ? RTLIB::getFPTOSINT(SVT, NVT) : RTLIB::getFPTOUINT(SVT, NVT);
- }
- assert(LC != RTLIB::UNKNOWN_LIBCALL && "Unsupported FP_TO_XINT!");
+ assert(findConversionLibcall(LC, SVT, RVT, NVT, Signed) &&
+ "Unsupported FP_TO_XINT!");
----------------
This won't execute findConversionLibcall in a release build. assert is a macro, nothing passed to it will be evaluated if asserts aren't enabled.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D92473/new/
https://reviews.llvm.org/D92473
More information about the llvm-commits
mailing list