[llvm-commits] patch: preserve branch to unreachable until codegenprep time
Nick Lewycky
nicholas at mxc.ca
Sun Oct 18 09:45:42 PDT 2009
Duncan Sands wrote:
> Hi Nick Lewycky,
>
>> This patch moves the code that optimizes "branch to unreachable" from
>> SimplifyCFG to CodeGenPrep. Most of this patch is just updating the
>> unit tests that use unreachable everywhere. I've done my best to
>> preserve the intent of the tests.
>
> so does this mean I can now teach LLVM about the ranges of Ada variables
> by doing something like (suppose the variable only takes values in 0..5)
>
> if (variable > 5)
> unreachable;
>
> and now LLVM passes will reason about it rather than eliminating it?
That's the idea, but we still have to make sure that the optimizers
actually *do* that.
GVN should do some of that right off the bat but I'd appreciate some
help in going through and finding cases where the optimizers could take
advantage of it but don't -- and then in fixing those cases. :)
Nick
More information about the llvm-commits
mailing list