[llvm] Add known and demanded bits support for zext nneg (PR #70858)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 11:33:27 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 89a2e701596835ba2714e190990da09d4e976a9a 5a5376184e71c3986402c7aab8792b5bcf6e2e31 -- llvm/lib/Analysis/ValueTracking.cpp llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.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 84362085dfa5..a44a644b7bd7 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -1103,8 +1103,7 @@ static void computeKnownBitsFromOperator(const Operator *I,
     assert(SrcBitWidth && "SrcBitWidth can't be zero");
     Known = Known.anyextOrTrunc(SrcBitWidth);
     computeKnownBits(I->getOperand(0), Known, Depth + 1, Q);
-    if (auto *Inst = dyn_cast<PossiblyNonNegInst>(I);
-        Inst && Inst->hasNonNeg())
+    if (auto *Inst = dyn_cast<PossiblyNonNegInst>(I); Inst && Inst->hasNonNeg())
       Known.makeNonNegative();
     Known = Known.zextOrTrunc(BitWidth);
     break;

``````````

</details>


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


More information about the llvm-commits mailing list