[llvm] [BasicAA] Use nuw attribute of GEPs (PR #98608)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 15 03:09:52 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:
No GEP would be equivalent to a zero-offset GEP, for which all of inbounds, nusw, and nuw always hold. In the past, it was unclear whether inbounds held for zero-offset GEPs, but this has been decided now. As such, initializing this to all() is correct, and should make things a bit simpler because we don't need the separate flag.
https://github.com/llvm/llvm-project/pull/98608
More information about the llvm-commits
mailing list