-
Notifications
You must be signed in to change notification settings - Fork 58
Imaging-mode PLT codegen and relocatable TLS #743
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
base: master
Are you sure you want to change the base?
Conversation
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/execution.jl b/src/execution.jl
index 22dd592..c37f264 100644
--- a/src/execution.jl
+++ b/src/execution.jl
@@ -280,11 +280,11 @@ end
error(
"""Did not find CodeInstance for $job.
- Pleaase make sure that the `compiler` function passed to `cached_compilation`
- invokes GPUCompiler with exactly the same configuration as passed to the API.
+ Pleaase make sure that the `compiler` function passed to `cached_compilation`
+ invokes GPUCompiler with exactly the same configuration as passed to the API.
- Note that you should do this by calling `GPUCompiler.compile`, and not by
- using reflection functions (which alter the compiler configuration)."""
+ Note that you should do this by calling `GPUCompiler.compile`, and not by
+ using reflection functions (which alter the compiler configuration)."""
)
end
key = (ci, cfg)
diff --git a/src/ptx.jl b/src/ptx.jl
index 0a340b9..f4ae4bd 100644
--- a/src/ptx.jl
+++ b/src/ptx.jl
@@ -459,8 +459,8 @@ function nvvm_reflect!(fun::LLVM.Function)
end
if !isa(sym, LLVM.GlobalVariable)
@safe_error """Unrecognized format of __nvvm_reflect call:
- $(string(call))
- Operand should be a global variable, got a $(typeof(sym)). Please file an issue."""
+ $(string(call))
+ Operand should be a global variable, got a $(typeof(sym)). Please file an issue."""
continue
end
sym_op = operands(sym)[1]
diff --git a/test/helpers/test.jl b/test/helpers/test.jl
index 8e9c996..432e246 100644
--- a/test/helpers/test.jl
+++ b/test/helpers/test.jl
@@ -22,17 +22,17 @@ end
@inline @generated function sink(i::T, ::Val{addrspace} = Val(0)) where {T <: Union{Int32, UInt32}, addrspace}
as_str = addrspace > 0 ? " addrspace($addrspace)" : ""
llvmcall_str = """%slot = alloca i32$(addrspace > 0 ? ", addrspace($addrspace)" : "")
- store volatile i32 %0, i32$(as_str)* %slot
- %value = load volatile i32, i32$(as_str)* %slot
- ret i32 %value"""
+ store volatile i32 %0, i32$(as_str)* %slot
+ %value = load volatile i32, i32$(as_str)* %slot
+ ret i32 %value"""
return :(Base.llvmcall($llvmcall_str, T, Tuple{T}, i))
end
@inline @generated function sink(i::T, ::Val{addrspace} = Val(0)) where {T <: Union{Int64, UInt64}, addrspace}
as_str = addrspace > 0 ? " addrspace($addrspace)" : ""
llvmcall_str = """%slot = alloca i64$(addrspace > 0 ? ", addrspace($addrspace)" : "")
- store volatile i64 %0, i64$(as_str)* %slot
- %value = load volatile i64, i64$(as_str)* %slot
- ret i64 %value"""
+ store volatile i64 %0, i64$(as_str)* %slot
+ %value = load volatile i64, i64$(as_str)* %slot
+ ret i64 %value"""
return :(Base.llvmcall($llvmcall_str, T, Tuple{T}, i))
end
@@ -112,10 +112,10 @@ module FileCheck
seekstart(output_io)
filecheck_io = Pipe()
cmd = ```$(filecheck_exe())
- --color
- --allow-unused-prefixes
- --check-prefixes $(join(prefixes, ','))
- $path```
+ --color
+ --allow-unused-prefixes
+ --check-prefixes $(join(prefixes, ','))
+ $path```
proc = run(pipeline(ignorestatus(cmd); stdin = output_io, stdout = filecheck_io, stderr = filecheck_io); wait = false)
close(filecheck_io.in)
diff --git a/test/native.jl b/test/native.jl
index c6d9916..db8418b 100644
--- a/test/native.jl
+++ b/test/native.jl
@@ -388,15 +388,15 @@ end
Base.llvmcall(
(
"""
- declare void @barrier() #1
+ declare void @barrier() #1
- define void @entry() #0 {
- call void @barrier()
- ret void
- }
+ define void @entry() #0 {
+ call void @barrier()
+ ret void
+ }
- attributes #0 = { alwaysinline }
- attributes #1 = { convergent }""", "entry",
+ attributes #0 = { alwaysinline }
+ attributes #1 = { convergent }""", "entry",
),
Nothing, Tuple{}
) |
|
Could you for review undo the formatting commit? We haven't transitioned the entire repo and so there are lots of unrelated stuff that makes it harder to review your actual changes. |
|
I wonder if this is an AI-generated pull request, without human review. This is based on their other pull requests to many different projects. See say ocaml/ocaml#14369 (comment) |
|
See also tshort/StaticCompiler.jl#180 |
|
Yes, that Julia PR requires this one. |
|
|
||
| # Make sure any lingering TLS getters are rewritten even if upstream LLVM passes | ||
| # transformed them before the GPULowerPTLSPass had a chance to run. | ||
| if occursin("StaticCompilerTarget", string(typeof(job.config.target))) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the opposite of the code pattern we use, we should never hard code a specific target here, but rather expose hooks for a target to configure the pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would strongly prefer small, self contained PRs with tests for each features.
preserving older compat.
intrinsic and inttoptr forms and ensuring the pass runs after upstream
transforms.
These changes are required for runtime-linked StaticCompiler targets. Without these GPUCompiler patches, executables that link the Julia runtime would bake absolute TLS addresses and crash at startup.