Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the preheader subst map computation in SESE canonicalization. #19324

Merged
merged 3 commits into from Sep 17, 2018

Conversation

bgogul
Copy link
Collaborator

@bgogul bgogul commented Sep 14, 2018

Refactoring some code that I find useful for subsequent PRs.

@bgogul
Copy link
Collaborator Author

bgogul commented Sep 14, 2018

@swift-ci please test tensorflow linux

@bgogul
Copy link
Collaborator Author

bgogul commented Sep 14, 2018

@swift-ci please test tensorflow macos

@bgogul bgogul requested review from mhong and rxwei September 14, 2018 20:49
@@ -316,6 +316,13 @@ class SingleExitLoopTransformer {

void initialize();

/// Return a map that captures information about what SILValue should be
/// used at the pre-header of the loop for every SILValue in the given
/// `values` set. If it cannnot find a suitable SILValue for an entry in
Copy link
Member

Choose a reason for hiding this comment

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

typo: cannot

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

}
// Do not eliminate undefs unless requested for.
if (!TFNoUndefsInSESE) return result;
Copy link
Member

Choose a reason for hiding this comment

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

Seems to be a double-width space before return?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

@@ -403,14 +423,14 @@ void SingleExitLoopTransformer::initialize() {

llvm::DenseMap<SILValue, SILValue>
SingleExitLoopTransformer::computeEscapingValues() const {
Copy link
Contributor

Choose a reason for hiding this comment

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

can this be a static method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately no as it relies on some object state.

Copy link
Collaborator Author

@bgogul bgogul left a comment

Choose a reason for hiding this comment

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

Thanks for the review.

@@ -403,14 +423,14 @@ void SingleExitLoopTransformer::initialize() {

llvm::DenseMap<SILValue, SILValue>
SingleExitLoopTransformer::computeEscapingValues() const {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately no as it relies on some object state.

}
// Do not eliminate undefs unless requested for.
if (!TFNoUndefsInSESE) return result;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done.

@@ -316,6 +316,13 @@ class SingleExitLoopTransformer {

void initialize();

/// Return a map that captures information about what SILValue should be
/// used at the pre-header of the loop for every SILValue in the given
/// `values` set. If it cannnot find a suitable SILValue for an entry in
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@bgogul bgogul merged commit 696c992 into apple:tensorflow Sep 17, 2018
@bgogul bgogul deleted the move_equivalent_values branch September 19, 2018 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants