[llvm] [InstCombine] Remove over-generalization from computeKnownBitsFromCmp() (PR #72637)

via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 17 02:51:25 PST 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 a67b85ef63c7ec29c2076294e3f7c7f923144a53 3d4581c38b44372b2acd57038b79b2a1e631a7eb -- llvm/lib/Analysis/AssumptionCache.cpp llvm/lib/Analysis/ValueTracking.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 10a4a6e349..e9bad3dfb8 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -658,8 +658,7 @@ static void computeKnownBitsFromCmp(const Value *V, const ICmpInst *Cmp,
       Known.Zero |= ~*C & *Mask;
       Known.One |= *C & *Mask;
       // assume(V | Mask = C)
-    } else if (match(Cmp,
-                     m_ICmp(Pred, m_Or(m_V, m_APInt(Mask)), m_APInt(C)))) {
+    } else if (match(Cmp, m_ICmp(Pred, m_Or(m_V, m_APInt(Mask)), m_APInt(C)))) {
       // For zero bits in Mask, we can propagate bits from C to V.
       Known.Zero |= ~*C & ~*Mask;
       Known.One |= *C & ~*Mask;

``````````

</details>


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


More information about the llvm-commits mailing list