Skip to content

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Jan 19, 2021

When promoting heap to stack allocations, make sure we only emit legal integer allocas by checking with the module's datalayout. X86 doesn't seem to care, but back-ends like SPIR-V don't know how to handle arbitrarily-sized integers.

Fixes JuliaGPU/oneAPI.jl#55

When promoting heap to stack allocations, make sure we only emit legal
integer allocas by checking with the module's datalayout. X86 doesn't
seem to care, but back-ends like SPIR-V don't know how to handle
arbitrarily-sized integers.

Fixes JuliaGPU/oneAPI.jl#55
@maleadt maleadt added compiler:codegen Generation of LLVM IR and native code gpu Affects running Julia on a GPU backport 1.6 Change should be backported to release-1.6 labels Jan 19, 2021
@maleadt maleadt requested a review from yuyichao January 19, 2021 10:38
@maleadt
Copy link
Member Author

maleadt commented Jan 19, 2021

.@Keno comments that it's the back-end's task to legalize these, and wide types like this could get introduced elsewhere, so this should be fixed in the LLVM to SPIR-V translator: KhronosGroup/SPIRV-LLVM-Translator#481. But even with isLegalInteger being more of a hint it makes sense to use it here (while working around the oneAPI.jl issue).

@maleadt maleadt merged commit a91131f into master Jan 19, 2021
@maleadt maleadt deleted the tb/legal_alloc_opt branch January 19, 2021 17:12
@KristofferC KristofferC mentioned this pull request Jan 20, 2021
60 tasks
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Feb 1, 2021
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.

Strange error InvalidBitWidth: Invalid bit width in input: 96
4 participants