[llvm] [InstCombine] optimize powi(X, C1)/powi(X, C2) with Ofast (PR #69807)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 21 00:44:02 PDT 2023


nikic wrote:

A variant of this fold already exists here: https://github.com/llvm/llvm-project/blob/386f3903910aa1897c424ced8e1af7993a6df5ce/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp#L1641 This transforms `/ powi(x, y)` to `* powi(x, -y)`. It just requires different fast math flags, in particular `arcp`. You can see it in action here: https://llvm.godbolt.org/z/jfPj74s9f

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


More information about the llvm-commits mailing list