[InstCombine] refactor mul narrowing folds; NFCI
authorSanjay Patel <spatel@rotateright.com>
Fri, 14 Sep 2018 22:23:35 +0000 (22:23 +0000)
committerSanjay Patel <spatel@rotateright.com>
Fri, 14 Sep 2018 22:23:35 +0000 (22:23 +0000)
commit90a36346bc9a42d7f98851501708fee1c630a47a
tree0f778ee62736e4504f253d8afa26c76d3dde3919
parent8ccc7bc27c112c280976fcdd793203bb05c02520
[InstCombine] refactor mul narrowing folds; NFCI

Similar to rL342278:
The test diffs are all cosmetic due to the change in
value naming, but I'm including that to show that the
new code does perform these folds rather than something
else in instcombine.

D52075 should be able to use this code too rather than
duplicating all of the logic.

llvm-svn: 342292
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/narrow-math.ll