[JumpThreading] Unfold selects that depend on the same condition
authorPablo Barrio <pablo.barrio@arm.com>
Tue, 8 Nov 2016 14:53:30 +0000 (14:53 +0000)
committerPablo Barrio <pablo.barrio@arm.com>
Tue, 8 Nov 2016 14:53:30 +0000 (14:53 +0000)
commit9f4525413887f1d7328279823ef816d4c4ff200f
tree76958fd10cb12557d5221e7397473fdf8035e3c1
parent1a5411238ef5f259404e6703af745256f2c39bca
[JumpThreading] Unfold selects that depend on the same condition

Summary:
These are good candidates for jump threading. This enables later opts
(such as InstCombine) to combine instructions from the selects with
instructions out of the selects. SimplifyCFG will fold the select
again if unfolding wasn't worth it.

Patch by James Molloy and Pablo Barrio.

Reviewers: rengolin, haicheng, sebpop

Subscribers: jojo, jmolloy, llvm-commits

Differential Revision: https://reviews.llvm.org/D26391

llvm-svn: 286236
llvm/include/llvm/Transforms/Scalar/JumpThreading.h
llvm/lib/Transforms/Scalar/JumpThreading.cpp
llvm/test/Transforms/JumpThreading/unfold-selects-same-cond.ll [new file with mode: 0644]