[PATCH] D24964: TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 07:22:41 PDT 2016


tstellarAMD created this revision.
tstellarAMD added reviewers: bogner, arsenm.
tstellarAMD added a subscriber: llvm-commits.
Herald added a subscriber: wdng.

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.

https://reviews.llvm.org/D24964

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/TargetLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24964.72649.patch
Type: text/x-patch
Size: 5786 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160927/51d1cd58/attachment.bin>


More information about the llvm-commits mailing list