[PATCH] D34762: [JumpThreading] Add a pattern to TryToUnfoldSelectInCurrBB()

Haicheng Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 09:55:59 PDT 2017


haicheng created this revision.

Add the following pattern to TryToUnfoldSelectInCurrBB()

  bb:
     %p = phi [0, %bb1], [1, %bb2], [0, %bb3], [1, %bb4], ...
     %c = cmp %p, 0
     %s = select %c, trueval, falseval

The Select in the above pattern will be unfolded and then jump-threaded.  The current implementation does not allow CMP in the middle of PHI and Select.


Repository:
  rL LLVM

https://reviews.llvm.org/D34762

Files:
  lib/Transforms/Scalar/JumpThreading.cpp
  test/Transforms/JumpThreading/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34762.104443.patch
Type: text/x-patch
Size: 5958 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170628/83ad90a5/attachment.bin>


More information about the llvm-commits mailing list