Re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions.
authorJustin Lebar <jlebar@google.com>
Wed, 7 Mar 2018 16:56:49 +0000 (16:56 +0000)
committerJustin Lebar <jlebar@google.com>
Wed, 7 Mar 2018 16:56:49 +0000 (16:56 +0000)
commiteccfbf1bcdea5d69ccdc7b568392054ccda1403e
tree24634d75e4d3eeaa3b637fce6653ab269128ca7b
parent347d12b4ceb270f1c06f18008f07fcb0148497fb
Re-land: Teach CorrelatedValuePropagation to reduce the width of udiv/urem instructions.

Summary:
If the operands of a udiv/urem can be proved to fit within a smaller
power-of-two-sized type, reduce the width of the udiv/urem.

Backed out for failing an assert in clang bootstrap builds.  Re-landing
with a fix for handling non-power-of-two inputs (e.g. udiv i24).

Original Differential Revision: https://reviews.llvm.org/D44102

llvm-svn: 326908
llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
llvm/test/Transforms/CorrelatedValuePropagation/udiv.ll [new file with mode: 0644]
llvm/test/Transforms/CorrelatedValuePropagation/urem.ll [new file with mode: 0644]