Page MenuHomePhabricator

[NFC][IR] add comments and a unit test for User::replaceUsesOfWith
ClosedPublic

Authored by ChuanqiXu on Jul 19 2020, 11:07 PM.

Details

Reviewers
junparser
Summary

The origin comment in User::replaceUsesOfWith writes:

if (getOperand(i) == From) {  // Is This operand is pointing to oldval?
      // The side effects of this setOperand call include linking to
      // "To", adding "this" to the uses list of To, and
      // most importantly, removing "this" from the use list of "From".
      setOperand(i, To);// fix it now
    }

The line fix it now looks like we need a patch here to achieve the effects described above. However, the effects had been implemented. So I think it is more clear to delete this comment.

Diff Detail

Event Timeline

ChuanqiXu created this revision.Jul 19 2020, 11:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2020, 11:07 PM

For NFC changes please tag so (you can find plenty of examples in the history). Please upload the full diff (arc diff or git diff 'HEAD^' -U9999).


When you commit, please drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (--date=now is my personal preference (author dates are usually not useful. Using committer dates can make log almost monotonic in time))

llvm/utils/git/pre-push.py can validate the message does not include unneeded tags.

ChuanqiXu retitled this revision from [IR] add comments and a unit test for User::replaceUsesOfWith to [NFC][IR] add comments and a unit test for User::replaceUsesOfWith.Jul 22 2020, 8:16 PM
ChuanqiXu updated this revision to Diff 280017.Jul 22 2020, 8:22 PM

For NFC changes please tag so (you can find plenty of examples in the history). Please upload the full diff (arc diff or git diff 'HEAD^' -U9999).


When you commit, please drop Reviewers: Subscribers: Tags: and the text Summary: from the git commit with the following script:

arcfilter () {
        arc amend
        git log -1 --pretty=%B | awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | git commit --amend --date=now -F -
}

Reviewed By: is considered important by some people. Please keep the tag. (--date=now is my personal preference (author dates are usually not useful. Using committer dates can make log almost monotonic in time))

llvm/utils/git/pre-push.py can validate the message does not include unneeded tags.

Hi, thank you! I am a newbie here. And I don't know much rule here. Thanks for reminding me this.

This revision is now accepted and ready to land.Jul 23 2020, 6:36 PM
ChuanqiXu closed this revision.Aug 2 2020, 8:19 PM