[PATCH] D87314: [IRSim][IROutliner] Allowing call instructions to be outlined.

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 10:15:52 PDT 2020


jroelofs accepted this revision.
jroelofs added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/include/llvm/Transforms/IPO/IROutliner.h:248
     bool IntrinsicInst(IntrinsicInst &II) { return false; }
-    // TODO: Handle CallInsts, there will need to be handling for special kinds
-    // of calls, as well as calls to intrinsics.
-    bool visitCallInst(CallInst &CI) { return false; }
+    // We only handle CallInsts that are not indirect, since we cannot guarantee
+    // that they have a name in these cases.
----------------
AndrewLitteken wrote:
> jroelofs wrote:
> > I don't follow the logic behind needing a name for this to work. ISTM you could pass the callee pointer as another new arg, and everything else would Just Work (TM). What am I missing?
> I don’t think you’re missing anything on that front. I just hadn’t considered writing it like that before. The same name just ensures that we are outlining the exact same function in both cases without any sort of argument handling, if it’s indirect, we can’t guarantee that.
> 
> However I think that it might be best to handle indirect calls in a separate patch later on since it adds a layer of complexity onto handling the arguments (see https://reviews.llvm.org/D87294 for an example of how it would be handled).
👍 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87314



More information about the llvm-commits mailing list