[llvm] [InstCombine] optimize powi(X,Y)/X with Ofast (PR #67236)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 20 05:46:42 PDT 2023
================
@@ -1764,6 +1764,22 @@ Instruction *InstCombinerImpl::visitFDiv(BinaryOperator &I) {
return replaceInstUsesWith(I, Pow);
}
+ // powi(X, Y) / X --> powi(X, Y-1)
+ // This is legal when (Y - 1) can't wraparound, in which case reassoc and nnan
+ // are required.
+ // Todo: Multi-use may be also better off creating Powi(x,y-1)
----------------
vfdff wrote:
Done
https://github.com/llvm/llvm-project/pull/67236
More information about the llvm-commits
mailing list