[PATCH] D99439: Update @llvm.powi to handle different int sizes for the exponent

Bjorn Pettersson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu May 13 01:59:49 PDT 2021


bjope added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:581
                                    RTLIB::POWI_F128,
                                    RTLIB::POWI_PPCF128);
   if (!TLI.getLibcallName(LC)) {
----------------
efriedma wrote:
> This is missing a diagnostic for the exponent.  We don't want to silently miscompile if someone uses an exponent that isn't supported by the target.
Not sure exactly what you suggest. Is that a general comment for all places in SelectionDAG where we may emit calls to RTLIB::POWI or what makes this SoftenFloatRes special?

If we end up using mismatching types in the call, wouldn't that being detected as ICE elsewhere? Only reason I made changes to this function in the first place was due to the historical assert above regarding the type of the exponent in FPOWI. Maybe I should just drop that assert instead? This is the only place where that is checked, but I figure that the SoftenFloatRes legalization is just one out of many places where FPOWI is legalized and lowered into libcalls to RTLIB::POWI.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99439



More information about the cfe-commits mailing list