This is an archive of the discontinued LLVM Phabricator instance.

[AVR] Optimize 16-bit ORs with '0'
ClosedPublic

Authored by anmol on Dec 26 2016, 8:16 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

anmol updated this revision to Diff 82524.Dec 26 2016, 8:16 PM
anmol retitled this revision from to [AVR] Optimize 16-bit ORs with '0' .
anmol updated this object.
anmol added a reviewer: dylanmckay.
anmol added a subscriber: llvm-commits.
dylanmckay edited edge metadata.Dec 26 2016, 8:49 PM

Looking really nice! Added a few nits

lib/Target/AVR/AVRExpandPseudoInsts.cpp
77 ↗(On Diff #82524)

As this method doesn't actually do any expansion and only returns a boolean, you should rename it to something like isLogicImmOpRedundant.

Also, you should add a const qualifier to the method.

225 ↗(On Diff #82524)

This temporary variable is unnecessary, plus it would be clearer if it looked if (expandLogicImmNeeded(..) { }

fhahn added a subscriber: fhahn.Dec 27 2016, 11:47 AM
anmol updated this revision to Diff 82615.Dec 28 2016, 12:52 PM
anmol edited edge metadata.
anmol marked 2 inline comments as done.

Thank you, for the review.

  • Renamed AVRExpandPseudo::expandLogicImmNeeded() to AVRExpandPseudo::isLogicImmOpRedundant()
  • AVRExpandPseudo::isLogicImmOpRedundant() is now const qualified.
  • Eliminated the temporary, so that the check for redundancy appears in the if's conditional clause. PS: The sense of the check is now inverted relative to the prior version.
dylanmckay accepted this revision.Dec 28 2016, 3:28 PM
dylanmckay edited edge metadata.

Looks good!

This revision is now accepted and ready to land.Dec 28 2016, 3:28 PM
anmol added a comment.Dec 29 2016, 7:04 AM

Looks good!

Thank you! What are the next steps to follow? How does it get into the mainline trunk sources? Do we change state to 'RESOLVED' once it does?

fhahn added a comment.Dec 29 2016, 2:05 PM

Somebody with commit access has to commit your change (with attribution) and Phabricator will close the review afterwards. PR 31344 needs to be closed manually afterwards.

If you do not have commit access it is best to ask somebody to commit your changes.

anmol added a comment.Dec 29 2016, 4:00 PM

Somebody with commit access has to commit your change (with attribution) and Phabricator will close the review afterwards. PR 31344 needs to be closed manually afterwards.

If you do not have commit access it is best to ask somebody to commit your changes.

Thank you, for helping me understand the process. Perhaps Dylan has commit access; let's wait to hear back from him.

This revision was automatically updated to reflect the committed changes.

Committed in r290732!

anmol added a comment.Dec 29 2016, 9:18 PM

Committed in r290732!

Thank you!