[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)
commit89176473336a28859db7d0ba548e5647a1482751
tree0364597129a65d2c99eec8da05e526fb517c917d
parentf7b1007345831e20e6b89bbc1dfcac6dbcaf9a99
[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

llvm-svn: 317510
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/test/Transforms/InstCombine/shift.ll