[llvm-commits] patch: moving unreachable elimination to codegenprep

Nick Lewycky nicholas at mxc.ca
Tue Feb 2 08:53:35 PST 2010


This is a resurrection of the patch first discussed back in October 2009 
to change the way unreachable is handled to make it live in the IR for 
as long as possible. The goal is to implement 
http://nondot.org/sabre/LLVMNotes/BuiltinUnreachable.txt in time for the 
LLVM 2.7 freeze so that python can make use of it when they land 
unladen-swallow.

This patch does most of the work of just moving the time unreachables 
are eliminated at late as possible, currently CodeGenPrep, and updates 
InlineCost and SCEV to handle it. Most of the patch is just updating 
codegen unit tests that use the unreachable instruction.

The primary concern from last time was the side-effects of keeping the 
chain of computation that fed into a dead branch. The 'extra' 
instructions could have effects on everything from inlining to loop 
analysis, but any approach short of cramming the entire expression into 
metadata attached to the branch would have the same problem.

I'd like to land this patch as soon as possible so that we have the best 
chance of dealing with any performance problems it causes before the 
code freeze!

Nick
-------------- next part --------------
A non-text attachment was scrubbed...
Name: preserve-unreachable2.patch
Type: text/x-patch
Size: 22724 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100202/6b923bf7/attachment.bin>


More information about the llvm-commits mailing list