[llvm] [InstCombine] Add log-pow simplification for FP exponent edge case. (PR #76641)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 3 09:51:28 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 3dc0638cfc19e140daff7bf1281648daca8212fa 39c428a696af89d4a01eccb2ee057e48098d9bbe -- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
index 3b65d8da52..35693ebb4c 100644
--- a/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
+++ b/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
@@ -2504,7 +2504,7 @@ Value *LibCallSimplifier::optimizeLog(CallInst *Log, IRBuilderBase &B) {
     Value *Y = Arg->getArgOperand(1);
     // Cast exponent to FP if integer.
     if (ArgID == Intrinsic::powi)
-        Y = B.CreateCast(Instruction::SIToFP, Y, Ty, "cast");
+      Y = B.CreateCast(Instruction::SIToFP, Y, Ty, "cast");
     Value *MulY = B.CreateFMul(Y, LogX, "mul");
     // Since pow() may have side effects, e.g. errno,
     // dead code elimination may not be trusted to remove it.

``````````

</details>


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


More information about the llvm-commits mailing list