[PATCH] D99438: [SimplifyLibCalls] Take size of int into consideration when emitting ldexp/ldexpf

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 11 13:41:33 PDT 2021


xbolva00 added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:55
   bool ShouldExtI32Param, ShouldExtI32Return, ShouldSignExtI32Param;
+  unsigned SizeOfInt = 32;
 
----------------
atrosinenko wrote:
> This initialization is probably redundant.
Not resolved yet.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1810
   if (AllowApprox && (isa<SIToFPInst>(Expo) || isa<UIToFPInst>(Expo))) {
-    if (Value *ExpoI = getIntToFPVal(Expo, B))
+    if (Value *ExpoI = getIntToFPVal(Expo, B, 32))
       return createPowWithIntegerExponent(Base, ExpoI, M, B);
----------------
bjope wrote:
> atrosinenko wrote:
> > Shouldn't it be `TLI->getIntSize()` as well?
> This patch only fixes "ldexp" family of libcalls. I'm dealing with "powi" in D99439 (having this patch as parent).
Can you add atleast fixme or todo?


================
Comment at: llvm/test/Transforms/InstCombine/pow_fp_int.ll:2
 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
-; RUN: opt -instcombine -S < %s | FileCheck %s
+; RUN: opt -mtriple unknown -instcombine -S < %s | FileCheck %s
 
----------------
Why this change?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99438



More information about the llvm-commits mailing list