[PATCH] D65979: [InstCombine] Simplify pow(2.0, itofp(y)) to ldexp(1.0, y)

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 11:03:37 PDT 2019


xbolva00 added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:1327
+    // Make sure that the exponent fits inside an int32_t,
+    // thus avoiding any range issues that the original expression has not.
+    unsigned BitWidth = ExpoI->getType()->getPrimitiveSizeInBits();
----------------
Can we extract this “fits in int” code to helper function? optimize exp2 checks it too, and that fold could use it too... and my powi fold too 

(Optional)


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

https://reviews.llvm.org/D65979





More information about the llvm-commits mailing list