[llvm] [X86] Prefer carry to overflow flag when using multiplication (PR #221611)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 11:20:17 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/Target/X86/X86FastISel.cpp llvm/lib/Target/X86/X86ISelLowering.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/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index a8f228ea6..a5ca264a2 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -249,7 +249,9 @@ bool X86FastISel::foldX86XALUIntrinsic(X86::CondCode &CC, const Instruction *I,
switch (II->getIntrinsicID()) {
default: return false;
case Intrinsic::sadd_with_overflow:
- case Intrinsic::ssub_with_overflow: TmpCC = X86::COND_O; break;
+ case Intrinsic::ssub_with_overflow:
+ TmpCC = X86::COND_O;
+ break;
case Intrinsic::smul_with_overflow:
case Intrinsic::umul_with_overflow:
case Intrinsic::uadd_with_overflow:
@@ -2861,9 +2863,13 @@ bool X86FastISel::fastLowerIntrinsicCall(const IntrinsicInst *II) {
case Intrinsic::usub_with_overflow:
BaseOpc = ISD::SUB; CondCode = X86::COND_B; break;
case Intrinsic::smul_with_overflow:
- BaseOpc = X86ISD::SMUL; CondCode = X86::COND_B; break;
+ BaseOpc = X86ISD::SMUL;
+ CondCode = X86::COND_B;
+ break;
case Intrinsic::umul_with_overflow:
- BaseOpc = X86ISD::UMUL; CondCode = X86::COND_B; break;
+ BaseOpc = X86ISD::UMUL;
+ CondCode = X86::COND_B;
+ break;
}
Register LHSReg = getRegForValue(LHS);
``````````
</details>
https://github.com/llvm/llvm-project/pull/221611
More information about the llvm-commits
mailing list