[llvm] [InstCombine] optimize exp(exp(x)) / exp(x) with fast-math (PR #66177)

Zain Jaffal via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 18 02:06:05 PDT 2023


zjaffal wrote:

> which means that the `x / exp(y)` to `x * exp(-y)` fold does not trigger

This example doesn't have an `exp(x)`. We should be able to handle this form as well right? I guess we can port the optimisations from `pow(x,y)` to the `exp(x)` 

>  However, you should still be able to handle something more general, such as exp(x) / exp(y) to exp(x - y) where exp(x) has one use

I guess my pattern should make sure that if `x` has multiple uses then all of them should be in the division operation  subtree so this should be able to handle `exp(x) / exp(y)` and `exp(exp(x)) / exp(x)` 

https://github.com/llvm/llvm-project/pull/66177


More information about the llvm-commits mailing list