[llvm] [InstCombine] Optimize powi(X, Y)/ (X * Z) with Ofast (PR #87047)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 29 03:01:17 PDT 2024


================
@@ -580,15 +580,21 @@ Instruction *InstCombinerImpl::foldFPSignBitOps(BinaryOperator &I) {
 
 Instruction *InstCombinerImpl::foldPowiReassoc(BinaryOperator &I) {
   auto createPowiExpr = [](BinaryOperator &I, InstCombinerImpl &IC, Value *X,
-                           Value *Y, Value *Z) {
+                           Value *Y, Value *Z, bool UpdateUsers = true) {
----------------
vfdff wrote:

In the new branch , the result of  **createPowiExpr(I, *this, X, Y, NegOne, false)**  is not return directly.
so it will missing to replace the later operand in **BinaryOperator::CreateFDivFMF(NewPow, Z, &I)**

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


More information about the llvm-commits mailing list