File tree Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Expand file tree Collapse file tree 2 files changed +0
-32
lines changed Original file line number Diff line number Diff line change 52
52
function _precompile_ ()
53
53
ccall (:jl_generating_output , Cint, ()) == 1 || return nothing
54
54
@assert precompile (Tuple{typeof (GPUCompiler. assign_args!),Expr,Vector{Any}})
55
- @assert precompile (Tuple{typeof (GPUCompiler. lower_trap!),LLVM. Module})
56
55
@assert precompile (Tuple{typeof (GPUCompiler. lower_unreachable!),LLVM. Function})
57
56
@assert precompile (Tuple{typeof (GPUCompiler. lower_gc_frame!),LLVM. Function})
58
57
@assert precompile (Tuple{typeof (GPUCompiler. lower_throw!),LLVM. Module})
Original file line number Diff line number Diff line change 187
187
188
188
function finish_ir! (@nospecialize (job:: CompilerJob{PTXCompilerTarget} ),
189
189
mod:: LLVM.Module , entry:: LLVM.Function )
190
- lower_trap! (mod)
191
190
for f in functions (mod)
192
191
lower_unreachable! (f)
193
192
end
246
245
247
246
# # LLVM passes
248
247
249
- # replace calls to `trap` with inline assembly calling `exit`, which isn't fatal
250
- function lower_trap! (mod:: LLVM.Module )
251
- job = current_job:: CompilerJob
252
- changed = false
253
- @timeit_debug to " lower trap" begin
254
-
255
- if haskey (functions (mod), " llvm.trap" )
256
- trap = functions (mod)[" llvm.trap" ]
257
-
258
- # inline assembly to exit a thread
259
- exit_ft = LLVM. FunctionType (LLVM. VoidType ())
260
- exit = InlineAsm (exit_ft, " exit;" , " " , true )
261
-
262
- for use in uses (trap)
263
- val = user (use)
264
- if isa (val, LLVM. CallInst)
265
- @dispose builder= IRBuilder () begin
266
- position! (builder, val)
267
- call! (builder, exit_ft, exit)
268
- end
269
- unsafe_delete! (LLVM. parent (val), val)
270
- changed = true
271
- end
272
- end
273
- end
274
-
275
- end
276
- return changed
277
- end
278
-
279
248
# lower `unreachable` to `exit` so that the emitted PTX has correct control flow
280
249
#
281
250
# During back-end compilation, `ptxas` inserts instructions to manage the harware's
You can’t perform that action at this time.
0 commit comments