diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2025-05-09 12:23:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-09 12:23:38 +0200 |
commit | 89d13f87c736d1a341959d03f3f9e5e65b95ebf5 (patch) | |
tree | 58483fc700093665377bd081dca33d2eb210c061 /llvm/lib/Analysis/Loads.cpp | |
parent | e854c381c6344b2ff8d1b58aa97008b4ecd9a9c5 (diff) | |
download | llvm-89d13f87c736d1a341959d03f3f9e5e65b95ebf5.zip llvm-89d13f87c736d1a341959d03f3f9e5e65b95ebf5.tar.gz llvm-89d13f87c736d1a341959d03f3f9e5e65b95ebf5.tar.bz2 |
Analysis: Remove no-AssumptionCache path in getKnowledgeForValue (#139232)
As requested in https://github.com/llvm/llvm-project/pull/138961#discussion_r2078483175
Diffstat (limited to 'llvm/lib/Analysis/Loads.cpp')
-rw-r--r-- | llvm/lib/Analysis/Loads.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/Loads.cpp b/llvm/lib/Analysis/Loads.cpp index b461c41..425f368 100644 --- a/llvm/lib/Analysis/Loads.cpp +++ b/llvm/lib/Analysis/Loads.cpp @@ -174,14 +174,14 @@ static bool isDereferenceableAndAlignedPointer( // information for values that cannot be freed in the function. // TODO: More precisely check if the pointer can be freed between assumption // and use. - if (CtxI && !V->canBeFreed()) { + if (CtxI && AC && !V->canBeFreed()) { /// Look through assumes to see if both dereferencability and alignment can /// be proven by an assume if needed. RetainedKnowledge AlignRK; RetainedKnowledge DerefRK; bool IsAligned = V->getPointerAlignment(DL) >= Alignment; if (getKnowledgeForValue( - V, {Attribute::Dereferenceable, Attribute::Alignment}, AC, + V, {Attribute::Dereferenceable, Attribute::Alignment}, *AC, [&](RetainedKnowledge RK, Instruction *Assume, auto) { if (!isValidAssumeForContext(Assume, CtxI, DT)) return false; |