[llvm] [InstCombine] Fold `ceil(X / (2 ^ C)) == 0` -> `X == 0` (PR #143683)

via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 22 02:38:26 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 h,cpp -- llvm/include/llvm/Analysis/ValueTracking.h llvm/lib/Analysis/ValueTracking.cpp llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 32c7ede47..0894ca920 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1303,7 +1303,8 @@ Instruction *InstCombinerImpl::foldICmpWithZero(ICmpInst &Cmp) {
   // where f(X) == 0 if and only if X == 0
   if (ICmpInst::isEquality(Pred))
     if (Value *Stripped = stripNullTest(Cmp.getOperand(0)))
-      return new ICmpInst(Pred, Stripped, Constant::getNullValue(Stripped->getType()));
+      return new ICmpInst(Pred, Stripped,
+                          Constant::getNullValue(Stripped->getType()));
 
   return nullptr;
 }

``````````

</details>


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


More information about the llvm-commits mailing list