[LLVMbugs] [Bug 17467] New: Remove throw when we can see the catch

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Oct 3 11:22:01 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=17467

            Bug ID: 17467
           Summary: Remove throw when we can see the catch
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: marc.glisse at normalesup.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

(sorry for the wrong "component" field, I don't know LLVM internals and can't
guess where this should go)

Hello,

this C++ code could be optimized to nothing:

void f(){
  try {
    throw 42;
  } catch(...){}
}

More generally, exception handling is quite slow, so whenever we can see (after
suitable inlining) the catch that would receive a given throw, it would be good
to replace it with a goto (not forgetting any destructor that needs to run,
etc). The heavy runtime machinery is useful when the catch happens in another
function, not so much when everything is local.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131003/0328e92e/attachment.html>


More information about the llvm-bugs mailing list