[llvm] [llvm] Optimize usub.sat fix for #79690 (PR #151044)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 18 09:50:03 PDT 2025
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 HEAD~1 HEAD --extensions cpp -- 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 cd0eb5900..745a2d10f 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -2062,8 +2062,8 @@ static Instruction *foldICmpUSubSatWithAndForMostSignificantBitCmp(
m_Constant(Const1)),
m_Intrinsic<Intrinsic::usub_sat>(
m_Value(B), m_Constant(Const2)))) &&
- (match(TrueVal, m_Zero()) && match(FalseVal, m_Constant(PossibleMSB))
- || match(TrueVal, m_Constant(PossibleMSB) ) && match(FalseVal, m_Zero()))) {
+ (match(TrueVal, m_Zero()) && match(FalseVal, m_Constant(PossibleMSB)) ||
+ match(TrueVal, m_Constant(PossibleMSB)) && match(FalseVal, m_Zero()))) {
auto *VecTy1 = dyn_cast<FixedVectorType>(Const1->getType());
auto *VecTy2 = dyn_cast<FixedVectorType>(Const2->getType());
auto *VecTyMSB = dyn_cast<FixedVectorType>(PossibleMSB->getType());
``````````
</details>
https://github.com/llvm/llvm-project/pull/151044
More information about the llvm-commits
mailing list