This is an archive of the discontinued LLVM Phabricator instance.

[SelectionDAG] ComputeNumSignBits of TRUNCATE operations
ClosedPublic

Authored by RKSimon on Nov 18 2016, 6:15 AM.

Details

Summary

Add basic ComputeNumSignBits support for TRUNCATE ops for cases where the source's number of sign bits overlaps with the truncated size.

Improves X86 SIGN_EXTEND_IN_REG vector cases which were needlessly sign extending boolean vector results.

Diff Detail

Repository
rL LLVM

Event Timeline

RKSimon updated this revision to Diff 78512.Nov 18 2016, 6:15 AM
RKSimon retitled this revision from to [SelectionDAG] ComputeNumSignBits of TRUNCATE operations.
RKSimon updated this object.
RKSimon set the repository for this revision to rL LLVM.
RKSimon added a subscriber: llvm-commits.
efriedma added inline comments.
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
2833 ↗(On Diff #78512)

Please use variable names which are not "Tmp" and "Tmp2".

RKSimon added inline comments.Nov 21 2016, 1:50 PM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
2833 ↗(On Diff #78512)

No problem - but these are the default variables that are already used in most of the other cases.

efriedma added inline comments.Nov 21 2016, 1:58 PM
lib/CodeGen/SelectionDAG/SelectionDAG.cpp
2833 ↗(On Diff #78512)

It probably isn't a good idea for the other cases. :)

RKSimon updated this revision to Diff 78775.Nov 21 2016, 1:58 PM

More meaningful variable names.

efriedma accepted this revision.Nov 21 2016, 2:06 PM
efriedma added a reviewer: efriedma.

LGTM.

This revision is now accepted and ready to land.Nov 21 2016, 2:06 PM
This revision was automatically updated to reflect the committed changes.