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

Verify IR after our own validation. #514

Merged
merged 1 commit into from
Sep 13, 2023
Merged

Conversation

maleadt
Copy link
Member

@maleadt maleadt commented Sep 13, 2023

Another hotfix for #510: Turns out the LLVM verifier can be unhappy about non-void kernels:

julia> invalid_kernel() = throw()
       @oneapi invalid_kernel()
ERROR: LLVM error: Calling convention requires void return type
{}* ()* @_Z14invalid_kernel

Stacktrace:
  [1] verify(mod::LLVM.Module)
    @ LLVM ~/Julia/pkg/LLVM/src/analysis.jl:10

... so make sure we validated the IR ourselves first.

It's not perfect, as our reflection macros invoke the driver with validate=false:

julia> @device_code_llvm @oneapi invalid_kernel()
; GPUCompiler.CompilerJob{GPUCompiler.SPIRVCompilerTarget, oneAPI.oneAPICompilerParams}(MethodInstance for invalid_kernel(), CompilerConfig for GPUCompiler.SPIRVCompilerTarget, 0x0000000000007f13)
ERROR: LLVM error: Calling convention requires void return type
{}* ()* @_Z14invalid_kernel

@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +8.46% 🎉

Comparison is base (c916b4e) 74.35% compared to head (605302e) 82.82%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #514      +/-   ##
==========================================
+ Coverage   74.35%   82.82%   +8.46%     
==========================================
  Files          24       24              
  Lines        3276     3289      +13     
==========================================
+ Hits         2436     2724     +288     
+ Misses        840      565     -275     
Files Changed Coverage Δ
src/driver.jl 88.66% <100.00%> (+26.60%) ⬆️

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maleadt maleadt merged commit f0655bd into master Sep 13, 2023
@maleadt maleadt deleted the tb/validate_then_verify branch September 13, 2023 11:51
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.

1 participant