[PATCH] D130896: [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI)
Alina Sbirlea via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 12 14:44:18 PDT 2022
asbirlea accepted this revision.
asbirlea added a comment.
LGTM.
================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:765
else if (Call->onlyAccessesInaccessibleMemOrArgMem())
- Min = FunctionModRefBehavior(Min & FMRB_OnlyAccessesInaccessibleOrArgMem);
+ Min = FunctionModRefBehavior::inaccessibleOrArgMemOnly(MR);
----------------
nikic wrote:
> asbirlea wrote:
> > Not sure how much it's worth avoiding the setting `anyLoc` when it gets overwritten right after.
> > Suggestion would be to do:
> > :759 FunctionModRefBehavior Min;
> >
> > :765
> > ```
> > else
> > Min = FunctionModRefBehavior::anyLoc(MR);
> > ```
> That would be nice, but C++ doesn't let us :( This would require a default constructor for FunctionModRefBehavior, and effectively initialize to FunctionModRefBehavior::none(). I don't think there is a good way to express this in C++ apart from either using some deeply nested ternaries or putting this in a separate function.
Yes, I meant initializing to FunctionModRefBehavior::none(), to avoid one codepath of iterating the locations for argmem and/or inaccessible. But if for the whole patch compile-time is not affected, taking this out shouldn't make much of a difference.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130896/new/
https://reviews.llvm.org/D130896
More information about the llvm-commits
mailing list