[llvm-commits] patch: preserve branch to unreachable until codegenprep time

Duncan Sands baldrick at free.fr
Sun Oct 18 05:27:25 PDT 2009


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?

Ciao,

Duncan.



More information about the llvm-commits mailing list