[PATCH] D130896: [AA] Tracking per-location ModRef info in FunctionModRefBehavior (NFCI)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 2 01:00:16 PDT 2022


nikic added a comment.

In D130896#3764753 <https://reviews.llvm.org/D130896#3764753>, @asbirlea wrote:

> I'm more curious if this change impacts compile-time, since it's being pretty general with the iteration over the number of locations possible and I'm not sure how much of that will be inlined.

Yeah, I was concerned about compile-time impact as well, but the change doesn't not seem to have any measurable impact.



================
Comment at: llvm/lib/Analysis/BasicAliasAnalysis.cpp:765
   else if (Call->onlyAccessesInaccessibleMemOrArgMem())
-    Min = FunctionModRefBehavior(Min & FMRB_OnlyAccessesInaccessibleOrArgMem);
+    Min = FunctionModRefBehavior::inaccessibleOrArgMemOnly(MR);
 
----------------
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.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130896/new/

https://reviews.llvm.org/D130896



More information about the llvm-commits mailing list