[llvm] [CVP] Extract computeNoWrapFlags helper from processBinOp (NFC). (PR #207527)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 04:42:12 PDT 2026


================
@@ -1176,9 +1176,33 @@ static bool processSIToFP(SIToFPInst *SIToFP, LazyValueInfo *LVI) {
   return true;
 }
 
-static bool processBinOp(BinaryOperator *BinOp, LazyValueInfo *LVI) {
+namespace {
+struct NoWrapFlags {
+  bool NSW = false;
+  bool NUW = false;
+};
----------------
antoniofrighetto wrote:

A bit nitpicking, though it seems like https://github.com/llvm/llvm-project/pull/207522 always uses the flags jointly. Having just an unsigned could make the code more compact (we have a few NUW/NSW booleans around here); this would only maybe get more verbose:
```cpp
setDeducedOverflowingFlags(BinOp, Opcode,
                           New & OBO::NoSignedWrap,
                           New & OBO::NoUnsignedWrap);
```
Feel free to ignore if you deem the struct more readable.

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


More information about the llvm-commits mailing list