[PATCH] D12979: Avoid inlining in exception handling context

Jun Bum Lim via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 21:21:41 PDT 2015


junbuml added inline comments.

================
Comment at: lib/Transforms/IPO/PruneEH.cpp:203
@@ +202,3 @@
+        MarkColdInEHR = true;
+        break;
+      }
----------------
hfinkel wrote:
> Why do you 'break;' here? If you do that, you'll only visit the first function in each call graph.
> 
> I think you want to have:
> 
>   if (!MarkColdInEHR && SCCMightUnwind) {
>     MarkColdInEHR = true;
>      for (CallGraphSCC::iterator I = SCC.begin(), E = SCC.end(); I != E; ++I) {
>        Function *F = (*I)->getFunction();
>        if (!F)
>          continue;
> 
>        AddColdForCSInEH(F);
>     }
>   }
> 
As I comment above, AddColdForCSInEH() does not need to be performed multiple times for each function. Since it handle all CallSites for __cxa_throw() in a module, it should be called only once per module. That's also why I have MarkColdInEHR . 


http://reviews.llvm.org/D12979





More information about the llvm-commits mailing list