[llvm] [BasicAA] Use nuw attribute of GEPs (PR #98608)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 03:51:13 PDT 2024


================
@@ -552,17 +552,17 @@ struct BasicAAResult::DecomposedGEP {
   APInt Offset;
   // Scaled variable (non-constant) indices.
   SmallVector<VariableGEPIndex, 4> VarIndices;
-  // Are all operations inbounds GEPs or non-indexing operations?
+  // Nowrap flags common to all GEP operations involved in expression.
   // (std::nullopt iff expression doesn't involve any geps)
-  std::optional<bool> InBounds;
+  std::optional<GEPNoWrapFlags> NWFlags;
----------------
nikic wrote:

```suggestion
  GEPNoWrapFlags NWFlags = GEPNoWrapFlags::all();
```
Should make things a bit clearer. I don't think the optional adds anything here...

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


More information about the llvm-commits mailing list