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

Easwaran Raman via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 25 14:30:15 PDT 2016


eraman created this revision.
eraman added reviewers: mcrosier, haicheng.
eraman added subscribers: davidxl, llvm-commits.

If we have a block (B1) with an otherwise-unthreadable branch on a compare, and its predecessors are terminated by an unconditional jump, try cloning it to a predecessor (B2) if B1 has a successor B3 which is terminated by a branch whose condition is known in B2. The cloning would result in an edge B2->B3 which could be potentially threaded with the branch that terminates B3. 

Part of this patch deals with renaming and refactoring DuplicateCondBranchOnPHIIntoPred and ProcessBranchOnPHI so that they can be reused to clone in this case. 

https://reviews.llvm.org/D22779

Files:
  include/llvm/Transforms/Scalar/JumpThreading.h
  lib/Transforms/Scalar/JumpThreading.cpp
  test/Transforms/JumpThreading/basic.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22779.65421.patch
Type: text/x-patch
Size: 8297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160725/d16cb323/attachment.bin>


More information about the llvm-commits mailing list