]> granicus.if.org Git - llvm/commit
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)
commit2e1f3bbb4bb422546b8696747ebb81c016768412
treead90025fede350e7b4de33bb6d08dec33f6f7921
parente5a36c1fc3c112fc3317d0b1a7fa0877072535d1
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284266 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/SelectionDAG/TargetLowering.cpp