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

Experiment with the ipo effects on LLVM #47844

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

gbaraldi
Copy link
Member

@gbaraldi gbaraldi commented Dec 9, 2022

I'm not sure about the correctness of this. Basically playing with it and asking for help.

This is very similar to what #32368 wanted to do

@brenhinkeller brenhinkeller added the compiler:llvm For issues that relate to LLVM label Dec 9, 2022
@gbaraldi
Copy link
Member Author

LLVM didn't really like speculatable coming there, I will need to think this a bit more through.

src/codegen.cpp Outdated Show resolved Hide resolved
#if JL_LLVM_VERSION >= 140000
AttrBuilder attr(C);
#else
AttrBuilder attr;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we could prefix all of the custom string attributes with julia. to avoid any namespace collisions

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, they are there mostly for debugging, we probably want a smarter way to encode this

attr.addAttribute("nothrow");
attr.addAttribute(Attribute::NoUnwind); // Is this even correct, because nothrow allows for try/catch
}
if (terminates == 1){
Copy link
Member

Choose a reason for hiding this comment

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

Add mustprogress here too?

Copy link
Member Author

Choose a reason for hiding this comment

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

willreturn already implies mustprogress but I guess it's fine adding both

src/codegen.cpp Outdated Show resolved Hide resolved
src/codegen.cpp Outdated Show resolved Hide resolved
src/codegen.cpp Outdated Show resolved Hide resolved
Comment on lines +576 to +582
if (nonoverlayed == 1)
attr.addAttribute("nonoverlayed");
Copy link
Member

Choose a reason for hiding this comment

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

Well do you have some idea to use this attribute? It's very Julia-compiler specific attribute.

Copy link
Member Author

Choose a reason for hiding this comment

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

Not really, I just wanted to see if I was getting all the effects correctly at the LLVM level, those string like attributes were just for debugging.

@aviatesk aviatesk added needs pkgeval Tests for all registered packages should be run with this change compiler:effects effect analysis labels Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:effects effect analysis compiler:llvm For issues that relate to LLVM needs pkgeval Tests for all registered packages should be run with this change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants