This is an archive of the discontinued LLVM Phabricator instance.

R600/SI: Allow commuting compares
ClosedPublic

Authored by arsenm on Feb 18 2015, 2:39 AM.

Details

Reviewers
arsenm
Summary

This enables very common cases to switch to the
smaller encoding.

All of the standard LLVM canonicalizations of comparisons
are the opposite of what we want. Compares with constants
are moved to the RHS, but the first operand can be an inline
immediate, literal constant, or SGPR using the 32-bit VOPC
encoding.

There are additional bad canonicalizations that should
also be fixed, such as canonicalizing ge x, k to gt x, (k + 1)
if this makes k no longer an inline immediate value.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 20157.Feb 18 2015, 2:39 AM
arsenm retitled this revision from to R600/SI: Allow commuting compares .
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a subscriber: Unknown Object (MLST).
arsenm accepted this revision.Apr 22 2015, 10:14 AM
arsenm added a reviewer: arsenm.
This revision is now accepted and ready to land.Apr 22 2015, 10:14 AM
arsenm closed this revision.Apr 22 2015, 10:14 AM