[PATCH] D86975: [IRSim][IROutliner] Adding the extraction basics for the IROutliner.

Jon Roelofs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 15 16:12:46 PDT 2020


jroelofs added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/IROutliner.cpp:238
+  // instruction.
+  for (Instruction &I : *RewrittenBB)
+    if (CallInst *CI = dyn_cast<CallInst>(&I))
----------------
AndrewLitteken wrote:
> jroelofs wrote:
> > Is it guaranteed that we'll find precisely one CallInst in this search? Should there be assertions to that effect?
> > 
> > Also, is it worth adding a `break` in the inner `if` to early exit once it has been found?
> There may be more than one `CallInst` due to lifetime instructions added by the code extractor, but there will not be more than one call to the outlined function.  So a break would be appropriate but an assertion would not be.
👍 


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

https://reviews.llvm.org/D86975



More information about the llvm-commits mailing list