TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt
authorTom Stellard <thomas.stellard@amd.com>
Fri, 14 Oct 2016 19:14:26 +0000 (19:14 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 14 Oct 2016 19:14:26 +0000 (19:14 +0000)
commitab610079142f420b09a10c3dfded03817bc1250d
treedf5ddfe24d84070c6b70b5a66e1112641b826bd4
parent88eff2575e77b2a67ae394f95e3850d3c746ad28
TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt

Summary:
The main purpose of this new helper is to enable simplifying operations that
have multiple uses.  SimplifyDemandedBits does not handle multiple uses
currently, and this new function makes it possible to optimize:

and v1, v0, 0xffffff
mul24 v2, v1, v1      ; Multiply ignoring high 8-bits.

To:

mul24 v2, v0, v0

Where before this would not be optimized, because v1 has multiple uses.

Reviewers: bogner, arsenm

Subscribers: nhaehnle, wdng, llvm-commits

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

llvm-svn: 284266
llvm/include/llvm/Target/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp