[llvm] [InstCombine] Set `samesign` when converting signed predicates into unsigned (PR #112642)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 17 01:24:31 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 566012a64e8d91dd7abca6aee0814ae293f412d5 961abf9c9774ae3f7e337831ef07c47855b5317e --extensions 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 2c697421ca..fb6d7a72f2 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -6771,7 +6771,8 @@ Instruction *InstCombinerImpl::foldICmpUsingKnownBits(ICmpInst &I) {
   }
 
   // Turn a signed comparison into an unsigned one if both operands are known to
-  // have the same sign. Set samesign if possible (except for equality predicates).
+  // have the same sign. Set samesign if possible (except for equality
+  // predicates).
   if ((I.isSigned() || (I.isUnsigned() && !I.hasSameSign())) &&
       ((Op0Known.Zero.isNegative() && Op1Known.Zero.isNegative()) ||
        (Op0Known.One.isNegative() && Op1Known.One.isNegative()))) {

``````````

</details>


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


More information about the llvm-commits mailing list