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

Strip address information from byval type parameters. #42395

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Sep 27, 2021

LLVM 12 introduced typed byval, but CloneFunctionInto does a plain copyAttributesFrom without rewriting contained types. The ValueMapper does the correct thing for calls though, so this looks like an oversight. But it's easy enough to fix that locally for now.

@maleadt maleadt added compiler:codegen Generation of LLVM IR and native code gpu Affects running Julia on a GPU backport 1.7 labels Sep 27, 2021
@vtjnash
Copy link
Member

vtjnash commented Sep 27, 2021

Why aren't you using similar code to the example link from LLVM?

@maleadt
Copy link
Member Author

maleadt commented Sep 28, 2021

I think some APIs used there only work on LLVM 13; on 12 the code there is specific to byval: https://github.com/llvm/llvm-project/blob/llvmorg-12.0.1/llvm/lib/Transforms/Utils/ValueMapper.cpp#L901-L915

@vchuravy
Copy link
Member

vchuravy commented Sep 28, 2021

I think this might apply to sret as well?

edit: Yeah https://github.com/llvm/llvm-project/blob/fed41342a82f5a3a9201819a82bf7a48313e296b/llvm/lib/Transforms/Utils/ValueMapper.cpp#L905 has sret as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:codegen Generation of LLVM IR and native code gpu Affects running Julia on a GPU
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants