[llvm] [InstCombine] optimize powi(X,Y)/X with Ofast (PR #67236)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 17 06:01:16 PDT 2023


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 12bf4231eb0d4685b9d8152352fbd15ac9fb528b 0a315069a4e627643e13681053dfbe21a924b6a6 -- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index 0e7657ba84c4..3cb1be5dd074 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -1771,8 +1771,8 @@ Instruction *InstCombinerImpl::visitFDiv(BinaryOperator &I) {
   if (I.hasAllowReassoc() && I.hasNoNaNs() &&
       match(Op0, m_OneUse(m_Intrinsic<Intrinsic::powi>(m_Specific(Op1),
                                                        m_Value(Y)))) &&
-      computeOverflowForSignedSub(Y, ConstantInt::get(Y->getType(), 1),
-                                  &I) == OverflowResult::NeverOverflows) {
+      computeOverflowForSignedSub(Y, ConstantInt::get(Y->getType(), 1), &I) ==
+          OverflowResult::NeverOverflows) {
     Constant *NegOne = ConstantInt::getAllOnesValue(Y->getType());
     Value *Y1 = Builder.CreateAdd(Y, NegOne);
     Type *Types[] = {Op1->getType(), Y1->getType()};

``````````

</details>


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


More information about the llvm-commits mailing list