[PATCH] D112290: [Attributor] Look through indirect calls

Shilei Tian via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 1 11:24:37 PDT 2023


tianshilei1992 added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:1727
+  if (const Function *Callee = dyn_cast<Function>(CB.getCalledOperand()))
+    return Pred(*Callee, 1);
+
----------------
`/*NumCallees=*/ 1`?


================
Comment at: llvm/lib/Transforms/IPO/Attributor.cpp:1015
+  for (Function *Callee : Callees)
+    if (!Pred(*Callee, Callees.size() == 1))
+      return false;
----------------
jdoerfert wrote:
> arsenm wrote:
> > Why the compare to 1 for a bool?
> If we have more than 1 potential callee we don't know if it is a "must" callee anymore. I haven't thought enough about this to be sure we need or don't need it but there is the possibility we want to distinguish callees that may be called here from the one that certainly is.
Probably instead of using `NumCallees` (I'm not sure if the CB will need the value), can we use something like `bool IsUnique`?


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

https://reviews.llvm.org/D112290



More information about the llvm-commits mailing list