Skip to content

[Test] Run copy-propagation on SILOptimizer/opaque_values_mandatory.sil. #38179

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

Conversation

nate-chandler
Copy link
Contributor

@nate-chandler nate-chandler commented Jun 30, 2021

No description provided.

The new flags sets the EnableCopyPropagation flag on the SILOpt[ion]s
class used to determine the behavior of sil-opt.
@nate-chandler nate-chandler force-pushed the ossa/test/SILOptimizer/opaque_values_mandatory.sil/enable-copy-propagation branch from 1aa1822 to 9a0bdf3 Compare July 1, 2021 01:26
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

This run-line looks good to me.

-enable-ossa-modules currently enables non-mandatory copy propagation at -O only just so we can get a good performance baseline.

@swift-ci
Copy link
Contributor

swift-ci commented Jul 1, 2021

Build failed
Swift Test OS X Platform
Git Sha - 9a0bdf3

@@ -122,6 +122,10 @@ static llvm::cl::opt<bool> EnableOSSAModules(
"this is disabled we do not serialize in OSSA "
"form when optimizing."));

static llvm::cl::opt<bool> EnableCopyPropagation(
Copy link
Contributor

@atrick atrick Jul 1, 2021

Choose a reason for hiding this comment

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

We actually have two options -enable-copy-propagation and -disable-copy-propagation, both of which default to 'false'. Enabling either one overrides the default pipeline behavior, which depends on the optimization level and whether OSSA is enabled.
That should fix the test failures.

Copy link
Contributor Author

@nate-chandler nate-chandler Jul 1, 2021

Choose a reason for hiding this comment

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

It looks like swift-frontend has those flags to control the EnableCopyPropagation and DisableCopyPropagation flags of the SILOptions class, but sil-opt doesn't (yet). Considering that they both have independent effects, it seems likely that at some point they'll both be useful for sil-opt. I went ahead and pushed another commit ( 7e5747b ) to add -disable-copy-propagation to sil-opt to set DisableCopyPropagation to true ( like -enable-copy-propagation does for EnableCopyPropagation in sil-opt as of 7e5747b ).

The test failures were

  Swift(macosx-x86_64) :: Interpreter/SDK/objc_bridge_cast.swift
  Swift(macosx-x86_64) :: Interpreter/SDK/objc_dealloc.swift

and seem to be unrelated, affecting other PRs, like https://ci.swift.org/job/swift-PR-macos/28081/consoleText .

The new flags sets the DisableCopyPropagation flag on the SILOpt[ion]s
class used to determine the behavior of sil-opt.
@nate-chandler
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@atrick atrick left a comment

Choose a reason for hiding this comment

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

LGTM

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

2 similar comments
@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

@nate-chandler
Copy link
Contributor Author

@swift-ci please test windows platform

@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test windows platform

1 similar comment
@nate-chandler
Copy link
Contributor Author

@swift-ci please clean test windows platform

@nate-chandler nate-chandler merged commit db6ea99 into swiftlang:main Jul 6, 2021
@nate-chandler nate-chandler deleted the ossa/test/SILOptimizer/opaque_values_mandatory.sil/enable-copy-propagation branch July 6, 2021 23:28
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.

3 participants