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

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 04:05:55 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;
----------------
hazzlim wrote:

Ah yes, I can see this case is actually spelled out in LangRef, thanks for pointing that out. Updated to initialize with all() and remove the now unnecessary conditional.

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


More information about the llvm-commits mailing list