[llvm] [polly] [SCEV] Rename SCEVNoWrapFlags to SCEVFlags (NFC) (PR #225179)

Ramkumar Ramachandra via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 02:13:02 PDT 2026


================
@@ -997,9 +1007,8 @@ class SCEVLoopAddRecRewriter
 };
 
 template <typename SCEVPtrT>
-inline SCEVUseT<SCEVPtrT>::SCEVUseT(SCEVPtrT S, SCEVNoWrapFlags Flags)
-    : Base(S, 0) {
-  if (any(Flags)) {
+inline SCEVUseT<SCEVPtrT>::SCEVUseT(SCEVPtrT S, SCEVFlags Flags) : Base(S, 0) {
+  if (any(Flags & SCEVFlags::FlagsNoWrapMask)) {
----------------
artagnon wrote:

So, the intent of this is to avoid asserting below:

```cpp
assert((isa<SCEVAddExpr, SCEVMulExpr, SCEVAddRecExpr(S)) && ...);
```

and clear no-wrap flags correctly.

The other Flags are not dropped anywhere. Below:

```cpp
Base::setInt(static_cast<unsigned>(Flags) >> 1);
```

Additionally, all callers of the SCEVUseT constructor check (NUW | NSW) on the use-flags already?

Not sure what remains to be done here?

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


More information about the llvm-commits mailing list