[PATCH] D12979: Avoid inlining in exception handling context

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 07:27:12 PDT 2015


hfinkel added inline comments.

================
Comment at: lib/Transforms/IPO/PruneEH.cpp:189
@@ -173,1 +188,3 @@
 
+  // If the SCC unwind, find CallSites in exception handling regions,
+  // and mark the NoInline attribute. Note that this need to be performed only
----------------
unwind -> unwinds

================
Comment at: lib/Transforms/IPO/PruneEH.cpp:190
@@ +189,3 @@
+  // If the SCC unwind, find CallSites in exception handling regions,
+  // and mark the NoInline attribute. Note that this need to be performed only
+  // once per module.
----------------
mark the -> mark them with the

================
Comment at: lib/Transforms/IPO/PruneEH.cpp:193
@@ +192,3 @@
+  if (!MarkNoInlineInEHR && SCCMightUnwind)
+    for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I)
+      if (Function *F = (*I)->getFunction())
----------------
You should MarkNoInlineInEHR = true; here instead of in AddNoinlineForCSInEH (no need to do the CGSCC traversal here to call functions that don't do anything).

Also, to maintain the general pass model, I think you need to override the pass's 'virtual bool doFinalization(Module &)' function and reset the MarkNoInlineInEHR flag to false.




http://reviews.llvm.org/D12979





More information about the llvm-commits mailing list