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

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 11 13:54:54 PDT 2021


efriedma added a comment.

Seems reasonable.  I'd like to see a test for autoupgrade; not sure if you need to make any code changes for that.



================
Comment at: llvm/docs/LangRef.rst:13282
+to one of the ``__powi*`` functions in compiler-rt. Not all targets support
 all types however.
 
----------------
Maybe make this a bit more explicit: move the description of the exponent into a separate paragraph, and explicitly state "generally, the only exponent supported is the C type `int`".


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp:581
                                    RTLIB::POWI_F128,
                                    RTLIB::POWI_PPCF128);
   if (!TLI.getLibcallName(LC)) {
----------------
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.


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