[llvm] [instcombine] fold range checks for bitwise and/or (PR #176642)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 19 10:05:09 PST 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/Transforms/InstCombine/InstCombineAndOrXor.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/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 04095325d..9523b707f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3617,8 +3617,9 @@ Value *InstCombinerImpl::foldBooleanAndOr(Value *LHS, Value *RHS,
Instruction::BinaryOps Opcode = IsAnd ? Instruction::And : Instruction::Or;
if (match(L, m_BinOp(Opcode, m_Value(A), m_Value(B))) ||
- (IsLogical && (IsAnd ? match(L, m_LogicalAnd(m_Value(A), m_Value(B)))
- : match(L, m_LogicalOr(m_Value(A), m_Value(B)))))) {
+ (IsLogical &&
+ (IsAnd ? match(L, m_LogicalAnd(m_Value(A), m_Value(B)))
+ : match(L, m_LogicalOr(m_Value(A), m_Value(B)))))) {
for (int i = 0; i < 2; ++i) {
Value *Inner = i == 0 ? A : B;
Value *Other = i == 0 ? B : A;
``````````
</details>
https://github.com/llvm/llvm-project/pull/176642
More information about the llvm-commits
mailing list