This is the straightforward lowering to exp(x) - 1.
I won't ask to split out the math conversion from "standard" conversion, yet, but have you considered implementing this (as well as rsqrt from which most of the code is duplicated) as a sort of expand-math conversion instead?
Splitting this out is on my todo list. I though about having a general lowering to libm / llvm intrinsics that converts everything into a form that can be mapped that way. Additionally, we will have a lowering to GPU intrinsics and also the explicit approximations that are currently being worked on. Then the user of these lowerings can choose between those three sets of patterns, depending on their use-case. WDYT?
Then the user of these lowerings can choose between those three sets of patterns, depending on their use-case. WDYT?
As long as the patterns are reusable so that the user can combine them and decide what is legal/illegal to chose a lowering strategy "per operation" :)
Sorry for not following up on this patch. I was very busy this week to work on a new op that we need for Kernel Generator broadcast specialization, and that is blocking and thus has priority over this patch.
I hope I can do the necessary adjustments to this patch soon.