[clang] [CIR] Store nsw/nuw as an OverflowFlags bit enum and split out saturated add/sub (PR #195618)

via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 08:46:24 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,h,c -- clang/include/clang/CIR/Dialect/Builder/CIRBaseBuilder.h clang/lib/CIR/CodeGen/CIRGenBuiltin.cpp clang/lib/CIR/CodeGen/CIRGenExpr.cpp clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp clang/lib/CIR/CodeGen/CIRGenFixedPointBuilder.h clang/lib/CIR/CodeGen/CIRGenFunction.cpp clang/lib/CIR/Dialect/IR/CIRDialect.cpp clang/lib/CIR/Dialect/Transforms/CIRCanonicalize.cpp clang/lib/CIR/Dialect/Transforms/TargetLowering/LowerItaniumCXXABI.cpp clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp clang/test/CIR/CodeGen/fixed-point-arith.cpp clang/test/CIR/CodeGenBuiltins/builtins-elementwise.c --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/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
index 7ba0b3c6d..ce53e4e9f 100644
--- a/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
+++ b/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp
@@ -3790,7 +3790,7 @@ convertOverflowFlags(cir::OverflowFlags cirFlags) {
       flags[] = {
           {cir::OverflowFlags::nsw, mlir::LLVM::IntegerOverflowFlags::nsw},
           {cir::OverflowFlags::nuw, mlir::LLVM::IntegerOverflowFlags::nuw},
-      };
+  };
 
   for (auto [cirFlag, llvmFlag] : flags) {
     if (bitEnumContainsAny(cirFlags, cirFlag))

``````````

</details>


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


More information about the cfe-commits mailing list