This is an archive of the discontinued LLVM Phabricator instance.

TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt
ClosedPublic

Authored by tstellarAMD on Sep 27 2016, 7:22 AM.

Details

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.

Diff Detail

Event Timeline

tstellarAMD retitled this revision from to TargetLowering: Add SimplifyDemandedBits() helper to TargetLoweringOpt.
tstellarAMD updated this object.
tstellarAMD added reviewers: bogner, arsenm.
tstellarAMD added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.