[JumpThreading] Unfold selects that depend on the same condition
authorPablo Barrio <pablo.barrio@arm.com>
Mon, 24 Oct 2016 13:04:45 +0000 (13:04 +0000)
committerPablo Barrio <pablo.barrio@arm.com>
Mon, 24 Oct 2016 13:04:45 +0000 (13:04 +0000)
commitf9e0d0b7d0217f91389ea8ecb91edc47c081d710
treec2d734e1399bcd75d66a319637060ddb059f792b
parent16706dcbd42e868f4605e661df15207217e95e4a
[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: reames, bkramer, mcrosier, gberry, haicheng, jmolloy, sebpop

Subscribers: jojo, rengolin, llvm-commits

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

llvm-svn: 284971
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]