[InstCombine] (bool X) * Y --> X ? Y : 0
authorSanjay Patel <spatel@rotateright.com>
Tue, 13 Feb 2018 20:41:22 +0000 (20:41 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 13 Feb 2018 20:41:22 +0000 (20:41 +0000)
commitcb8ac00f733fbf290179b011739770a8f17e1b03
tree3796b6ce462043bd9baae8d87d661fb84fa16ce9
parentfd520962590350c8072394771ced45b15ee93002
[InstCombine] (bool X) * Y --> X ? Y : 0

This is both a functional improvement for vectors and an
efficiency improvement for scalars. The existing code below
the new folds does the same thing for scalars, but in an
indirect and expensive way.

llvm-svn: 325048
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/test/Transforms/InstCombine/mul.ll