Skip to content

Strip address information from byval type parameters.#42395

Merged
maleadt merged 1 commit intomasterfrom
tb/remap_byval_type
Sep 30, 2021
Merged

Strip address information from byval type parameters.#42395
maleadt merged 1 commit intomasterfrom
tb/remap_byval_type

Conversation

@maleadt
Copy link
Copy Markdown
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
Copy Markdown
Member

vtjnash commented Sep 27, 2021

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

@maleadt
Copy link
Copy Markdown
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
Copy Markdown
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