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

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Feb 3 12:55:06 PST 2010


On Feb 2, 2010, at 9:21 PM, Nick Lewycky wrote:

> Jakob Stoklund Olesen wrote:
>> 
>> On Feb 2, 2010, at 8:53 AM, Nick Lewycky wrote:
>> 
>>> 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.
>> 
>> Nick, I couldn't find that discussion in the archives. Do you have any pointers?
> 
> http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20091012/089120.html

Thanks, it looks like Dan and Chris have already covered it.

[...]

> Jakob, I'll make the tweaks to InlineCost that you proposed and post an updated patch with the results of a nightly test run. Realize that I'm expecting no visible performance difference at all since no code in the nightly test uses __builtin_unreachable().

Thanks. 

Your update to InlineCost looks fine to me, but undead instructions feeding into the condition are still counted.

I would like this patch better if you would implement Chris' suggestion of DCE'ing unreachable blocks with conditions that are too gross for the optimizer. As it stands there can be arbitrarily complex instructions feeding into the condition.

/jakob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100203/9aa0a7fd/attachment.bin>


More information about the llvm-commits mailing list