[llvm] [InstCombine] Fold icmp of trunc nuw/nsw (PR #90436)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 29 00:56:55 PDT 2024


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 e1622e189e8c0ef457bfac528f90a7a930d9aad2 36d5822b85aab09e9b525f80713cacb863ee7a75 -- llvm/include/llvm/IR/PatternMatch.h 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 317b3aef40..8180749595 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1521,8 +1521,8 @@ InstCombinerImpl::foldICmpTruncWithTruncOrExt(ICmpInst &Cmp,
   else if (match(&Cmp, m_c_ICmp(Pred, m_NSWTrunc(m_Value(X)),
                                 m_OneUse(m_ZExtOrSExt(m_Value(Y)))))) {
     // Can fold trunc nsw + zext/sext for all predicates.
-    YIsSExt = isa<SExtInst>(Cmp.getOperand(0)) ||
-              isa<SExtInst>(Cmp.getOperand(1));
+    YIsSExt =
+        isa<SExtInst>(Cmp.getOperand(0)) || isa<SExtInst>(Cmp.getOperand(1));
   } else
     return nullptr;
 

``````````

</details>


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


More information about the llvm-commits mailing list