[PATCH] D87232: [SVE][CodeGen] Lower floating point -> integer conversions

Kerry McLaughlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 16 05:48:15 PDT 2020


kmclaughlin added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp:562
   // preferable. We choose SINT because that's the right thing on PPC.)
-  if (N->getOpcode() == ISD::FP_TO_UINT &&
+  if (!NVT.isScalableVector() && N->getOpcode() == ISD::FP_TO_UINT &&
       !TLI.isOperationLegal(ISD::FP_TO_UINT, NVT) &&
----------------
efriedma wrote:
> Why is isScalableVector() relevant here?
It's not really relevant here, when I first created the patch I thought that it was better not to replace `FP_TO_UINT` with `FP_TO_SINT` when promoting the result, but I think it's fine to do this for scalable types also.
I've removed the isScalableVector() from here and updated the affected tests (e.g. nxv2f64 -> nxv2i32) to check for `fcvtzs`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87232/new/

https://reviews.llvm.org/D87232



More information about the llvm-commits mailing list