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

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 01:48:24 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;
 
   void dump() const {
     print(dbgs());
     dbgs() << "\n";
   }
   void print(raw_ostream &OS) const {
-    OS << "(DecomposedGEP Base=" << Base->getName()
-       << ", Offset=" << Offset
+    OS << "(DecomposedGEP Base=" << Base->getName() << ", Offset=" << Offset
----------------
hazzlim wrote:

Done, and added `inbounds` here also for symmetry.

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


More information about the llvm-commits mailing list