[llvm] [InstCombine] Fold selection between less than zero and one (PR #69961)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 12:15:18 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 54fe7ef70069a48c252a7e1b0c6ed8efda0bc440 e25e74fcde189fd2f56ffa6562d8af84945e3d48 -- llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index 4fd3f4f594d7..c3120f41c245 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -3424,8 +3424,8 @@ Instruction *InstCombinerImpl::visitSelectInst(SelectInst &SI) {
       match(TrueVal, m_One()) &&
       match(FalseVal, m_LShr(m_Specific(A), m_APInt(C))) &&
       Pred == ICmpInst::ICMP_EQ && *C == 31) {
-    auto *Cond = Builder.CreateICmpSLE(A,
-                                       ConstantInt::getNullValue(A->getType()));
+    auto *Cond =
+        Builder.CreateICmpSLE(A, ConstantInt::getNullValue(A->getType()));
     return new ZExtInst(Cond, A->getType());
   }
 

``````````

</details>


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


More information about the llvm-commits mailing list