[llvm] [InstCombine] Simplify phi using KnownBits of condition (PR #134712)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 7 12:40:32 PDT 2025


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 HEAD~1 HEAD --extensions cpp -- llvm/lib/Analysis/ValueTracking.cpp llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 3bcfce75b..f4c23a455 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -850,7 +850,7 @@ void llvm::computeKnownBitsFromContext(const Value *V, KnownBits &Known,
         computeKnownBitsFromCond(V, BI->getCondition(), Known, Depth, Q,
                                  Invert);
       }
-     else
+    else
       for (BranchInst *BI : Q.DC->conditionsFor(V)) {
         BasicBlockEdge Edge0(BI->getParent(), BI->getSuccessor(0));
         if (Q.DT->dominates(Edge0, CxtIBB))
@@ -861,7 +861,7 @@ void llvm::computeKnownBitsFromContext(const Value *V, KnownBits &Known,
         if (Q.DT->dominates(Edge1, CxtIBB))
           computeKnownBitsFromCond(V, BI->getCondition(), Known, Depth, Q,
                                    /*Invert*/ true);
-    }
+      }
 
     if (Known.hasConflict())
       Known.resetAll();

``````````

</details>


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


More information about the llvm-commits mailing list