[PATCH] D154496: InstCombine: Fold ldexp(ldexp(x, a), b) -> ldexp(x, a + b)

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 5 05:47:09 PDT 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp:2381-2383
+    // It's also safe to fold if we know both exponents have the same sign since
+    // it would just double down on the overflow/underflow which would occur
+    // anyway.
----------------
foad wrote:
> Additionally it would be safe if both exponents are known to be <= 0, but I guess we don't have a helper function for that.
Right we totally lack FP range tracking


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

https://reviews.llvm.org/D154496



More information about the llvm-commits mailing list