[PATCH] D109907: [DSE] Use cached escape info for calls.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 20 09:37:48 PDT 2021


fhahn added inline comments.


================
Comment at: llvm/include/llvm/Analysis/AliasAnalysis.h:812
+  /// or reads the specified memory object \p Object. The caller must ensure the
+  /// object does not escape before the call.
+  ModRefInfo callCaptures(const CallBase *Call, const Value *Object) {
----------------
nikic wrote:
> I'm really confused by this API. My understanding is that it computes the ModRefInfo of the call under the assumption that the object is not captured before *or at* the call. The implementation skips over non-nocapture arguments on the premise that these must have already been checked. It only checks whether there are arguments that may mod/ref the object without capturing. With that in mind, the API name seems to be the opposite of what it actually does.
I changed it to `callNoCapturesBefore`, which should be more in line with `callCapturesBefore` which runs the capture-before checks. The naming is still not that great, I'd appreciate any suggestions.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D109907



More information about the llvm-commits mailing list