You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not that I have any knowledge of the current status nor any say in this, but constant folding sounds like a good idea in general, not just for exponentiation.
@jan-ferdinand Thanks for pointing it out. Agreed, constant folding is something we plan to do as part of adding some optimization passes to the IR in the future.
Codegen for something like a^b where both a and b are constants results in something like:
Ideally it should be something like:
and eventually this should be further optimized to just be
where a = 2 and b = 3.
This will involve making changes to both IR and codegen where evaluating the exponent before generating code could be an optimization pass.
Originally proposed by @bobbinth in #136 (comment)
The text was updated successfully, but these errors were encountered: