[PATCH] D104059: [WIP][Attributor] Derive AACallEdges attribute

Kuter Dinel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 14 20:11:44 PDT 2021


kuter added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/AttributorAttributes.cpp:8177
+        if (Fn && !A.isAssumedDead(IRPosition::value(*Val), this, &LivenessAA))
+          AddCalledFunction(Fn);
+      }
----------------
jdoerfert wrote:
> Rather than asking for liveness, use a generic value traversal to visit all potential values of Val. Each of which is a potential callee. Also make sure to handle the case where a callee is not known, e.g., a function pointer call. We need to add them to the call graph as unknown callees too.
Ok when I add the `genericValueTraversal` should we still keep the `getCallbackUses` function since it uses the callback metadata ?
There is also a `callees` meta data that is ment to annotate a call, it gurantees that the called function is one of the functions it specifies.
This seems useful for our purposes.  `getCallbackUses` doesn't use it.

I was planning to add a flag  to tell if there are any calls to a unknown function somethling like `bool hasUnknownCallee()` 

Also for us to be able to say that function `x` can't reach function `b`, we need to make sure that we know all functions that function `x` might ever call.  Meaning that if there are any functions that `x` can reach that has a unknown callee we can't tell for sure, right ?  



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104059



More information about the llvm-commits mailing list