Skip to content

Conversation

@jamesr66a
Copy link
Collaborator

@jamesr66a jamesr66a commented Oct 30, 2019

Stack from ghstack:

Differential Revision: D18219786

@jamesr66a jamesr66a requested a review from apaszke as a code owner October 30, 2019 01:52
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Oct 30, 2019
@jamesr66a jamesr66a requested review from suo and zdevito October 30, 2019 01:54
suo
suo previously requested changes Oct 31, 2019
Copy link
Member

@suo suo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some tests for this functionality? The IR Parser should make it not terrible

}

private:
Block* findCommonAncestorBlockWith(Node* n);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also a number of places where we do stuff like this, it could be nice to clean them up by using this API. Topological moves come to mind

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And…DCE? maybe? I don't remember

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could be refactored to using this API:

if (this->owningBlock() == n->owningBlock()) {

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I tried using this API for that isBeforeOrAfter but isBeforeOrAfter requires having pointers to the ancestors Nodes that reside in the common ancestor block

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry i meant to say isBeforeOrAfter could be refactored using this function. but actually i take it back

@zdevito zdevito removed their request for review October 31, 2019 21:57
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a few comments / nits

ASSERT_EQ(name_to_value.size(), 4);

/* clang-format off */
int ref_blocks_from_graph[4][4] = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Encoding expected results like this works, another alternative is to include your previous algorithm in this test file and check against that.

}

private:
Block* findCommonAncestorBlockWith(Node* n);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function could be refactored to using this API:

if (this->owningBlock() == n->owningBlock()) {

@zdevito zdevito removed their request for review November 6, 2019 18:11
@facebook-github-bot
Copy link
Contributor

@jamesr66a merged this pull request in 0f4b226.

@facebook-github-bot facebook-github-bot deleted the gh/jamesr66a/134/head branch November 10, 2019 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants