[PATCH] D12979: Avoid inlining in exception handling context

hfinkel@anl.gov via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 28 13:31:15 PDT 2015


hfinkel added inline comments.

================
Comment at: lib/Transforms/IPO/PruneEH.cpp:362
@@ +361,3 @@
+  // call void @__cxa_throw(i8* %exception, .. )
+  for (User *FnU : FnThrowE->users()) {
+    auto *ThrowCall = dyn_cast<CallInst>(FnU);
----------------
junbuml wrote:
> hfinkel wrote:
> > Why are you looking for users of __cxa_throw? Can we make the assumption that all user of __cxa_allocate_exception are essentially cold, and just look for the users of return values of that function?
> > 
> I'm trying to find all actual calls for __cxa_throw() by looking at the users of FnThrowE where an exception is thrown. 
> 
> Here, I specifically check the exception allocated to be thrown (__cxa_throw()) in throw statement, which should be cold unless the program logic highly rely on throw statement.
> 
> When a exception handling class is created in throw statement, 
> the constructor must take the exception used in __cxa_throw() as its first parameter.
> 
> Please correct me if I miss something.
> 
I understand what you're doing, but my question is this: Is the call to __cxa_allocate_exception itself cold? If so, perhaps that's all we need to find. Maybe looking for the __cxa_throw calls is an unnecessary complication.



http://reviews.llvm.org/D12979





More information about the llvm-commits mailing list