Skip to content

Conversation

@yuyichao
Copy link
Contributor

Mark more functions and calls as non-null and use inbounds gep instead of integer arithmetics
so that LLVM can more easily infer the non-null-ness of pointers. (Partially revert 2bb430e)

Also add inline optimization for ccall on jl_symbol_name and makes
sure the return value is treated as non-null by LLVM.

Mark more functions and calls as non-null and use inbounds gep instead of integer arithmetics
so that LLVM can more easily infer the non-null-ness of pointers. (Partially revert 2bb430e)

Also add inline optimization for `ccall` on `jl_symbol_name` and makes
sure the return value is treated as non-null by LLVM.
[](LLVMContext &C) { return AttributeList::get(C,
AttributeSet(),
Attributes(C, {Attribute::NoAlias, Attribute::NonNull}),
Attributes(C, {Attribute::NonNull}),
Copy link
Member

Choose a reason for hiding this comment

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

backport?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, this line of change is in principle a bug fix..... (commit was from a week ago and I've forgot about that...............)

Copy link
Member

@vtjnash vtjnash Aug 19, 2020

Choose a reason for hiding this comment

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

Yeah, I think I missed the second half of the langref documentation for this attribute. (for arguments, it means that it doesn't alias any mutable memory, but for return values, it also means the pointer itself is unique à la malloc)

@yuyichao
Copy link
Contributor Author

Back port label added for the single line change above to remove the incorrect return value attribute. (The back port should not use the commit message from this PR).

@yuyichao yuyichao merged commit 98aaeb0 into master Aug 21, 2020
@yuyichao yuyichao deleted the yyc/codegen/nonnull branch August 21, 2020 19:38
@KristofferC KristofferC mentioned this pull request Aug 26, 2020
29 tasks
@KristofferC
Copy link
Member

@yuyichao f59a4ff

simeonschaub pushed a commit to simeonschaub/julia that referenced this pull request Aug 29, 2020
Mark more functions and calls as non-null and use inbounds gep instead of integer arithmetics
so that LLVM can more easily infer the non-null-ness of pointers. (Partially revert 2bb430e)

Also add inline optimization for `ccall` on `jl_symbol_name` and makes
sure the return value is treated as non-null by LLVM.
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.

4 participants