OSDN Git Service

[InstCombine] Pull shifts through a select plus binop with constant
authorCraig Topper <craig.topper@intel.com>
Mon, 6 Nov 2017 21:07:22 +0000 (21:07 +0000)
committerCraig Topper <craig.topper@intel.com>
Mon, 6 Nov 2017 21:07:22 +0000 (21:07 +0000)
commitaceaaf0aecb41634ae29940a021745fd98221e63
treec820d9555f3c03bb19977a125d5365b5b8eb4aa5
parent82cd943eb1deceb561fb8e7c9ad7c796c883b2d3
[InstCombine] Pull shifts through a select plus binop with constant

This pulls shifts through a select+binop with a constant where the select conditionally executes the binop. We already do this for just the binop, but not with the select.

This can allow us to get the select closer to other selects to enable removing one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317510 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineShifts.cpp
test/Transforms/InstCombine/shift.ll