[llvm] [TypePromotion] Support trunc-to-i1 conditions (PR #216311)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 14 05:36:55 PDT 2026


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 origin/main HEAD --extensions cpp -- llvm/lib/CodeGen/TypePromotion.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/TypePromotion.cpp b/llvm/lib/CodeGen/TypePromotion.cpp
index 3749048d7..59ea4281f 100644
--- a/llvm/lib/CodeGen/TypePromotion.cpp
+++ b/llvm/lib/CodeGen/TypePromotion.cpp
@@ -278,8 +278,7 @@ bool TypePromotionImpl::isSink(Value *V) {
 }
 
 bool TypePromotionImpl::isSupportedTruncToI1(Value *V) {
-  return isTruncToI1(V) &&
-         EqualTypeSize(cast<TruncInst>(V)->getOperand(0));
+  return isTruncToI1(V) && EqualTypeSize(cast<TruncInst>(V)->getOperand(0));
 }
 
 /// Return whether this instruction can safely wrap.

``````````

</details>


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


More information about the llvm-commits mailing list