[llvm] [ConstraintElim] Do not allow overflows in `Decomposition` (PR #140541)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon May 19 12:52:49 PDT 2025


================
@@ -366,26 +352,38 @@ struct Decomposition {
   Decomposition(int64_t Offset, ArrayRef<DecompEntry> Vars)
       : Offset(Offset), Vars(Vars) {}
 
-  void add(int64_t OtherOffset) {
-    Offset = addWithOverflow(Offset, OtherOffset);
+  // Return true if the new decomposition is invalid.
----------------
fhahn wrote:

```suggestion
  /// Add \p OtherOffset and return true if the operation overflows, i.e. the new decomposition is invalid.
```

would be good to turn them all into doc-dcomments

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


More information about the llvm-commits mailing list