Skip to content

IRGen: Use argmemonly for a couple of readonly runtime functions #14310

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

aschwaighofer
Copy link
Contributor

No description provided.

@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@aschwaighofer
Copy link
Contributor Author

CC @jckarter

Copy link
Contributor Author

@aschwaighofer aschwaighofer left a comment

Choose a reason for hiding this comment

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

This is not correct. ArgMemOnly can only be use by functions that are accessing memory based on the pointer arguments.

@aschwaighofer
Copy link
Contributor Author

One of this functions must do more than just read from the pointer array to get the metatype arguments ... I am seeing failures in optimized mode.

@swift-ci
Copy link
Contributor

swift-ci commented Feb 1, 2018

Build failed
Swift Test OS X Platform
Git Sha - 7438c52

@swift-ci
Copy link
Contributor

swift-ci commented Feb 1, 2018

Build failed
Swift Test Linux Platform
Git Sha - 7438c52

@aschwaighofer
Copy link
Contributor Author

Or some code that initializes the arguments is inlined in llvm ir then you could have

Type *args[5];
pointer->field = // inlined initialization
arg[1] = pointer
argmemonly(args)

It would be legal for the optimizer to reorder to:

Type *args[5];
arg[1] = pointer
argmemonly(args)
pointer->field = // inlined initialization

@jckarter
Copy link
Contributor

jckarter commented Feb 1, 2018

Hm, that shouldn't happen, but it's probably not worth spending much time on right now.

@aschwaighofer
Copy link
Contributor Author

I filed https://bugs.swift.org/browse/SR-6889

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