[PATCH] D22779: Clone block with icmp+branch if it likely results in further jump threading

Haicheng Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 19 11:16:58 PDT 2016


haicheng added a comment.

In https://reviews.llvm.org/D22779#574260, @sebpop wrote:

> The idea is to perform the analysis backwards: one starts from a condition and walk back on the SSA to the definitions involved in that condition.
>  If on one of the paths the condition can be statically evaluated, then that path is duplicated, the condition is removed, and the final jump is to the destination evaluated at compile time.


JumpThreadingPass::ComputeValueKnownInPredecessors() can be used to do the backward analysis.


https://reviews.llvm.org/D22779





More information about the llvm-commits mailing list