@@ -26,7 +26,7 @@ See also: [`Libtask.consume`](@ref)
26
26
end
27
27
28
28
function callable_ret_type (sig)
29
- return Union{Base. code_ircode_by_type (sig)[1 ][2 ], ProducedValue}
29
+ return Union{Base. code_ircode_by_type (sig)[1 ][2 ],ProducedValue}
30
30
end
31
31
32
32
function build_callable (sig:: Type{<:Tuple} )
@@ -257,8 +257,6 @@ function stmt_might_produce(x)::Bool
257
257
# return false
258
258
end
259
259
260
- get_function (x:: Expr ) = x.
261
-
262
260
"""
263
261
produce_value(x::Expr)
264
262
@@ -376,7 +374,7 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
376
374
# 1. Associate an ID to each split in each block, ensuring that the ID for the final
377
375
# split of each block is the same ID as that of the original block.
378
376
all_split_ids = map (zip (ir. blocks, all_splits)) do (block, splits)
379
- return vcat ([ID () for _ in splits[1 : end - 1 ]], block. id)
377
+ return vcat ([ID () for _ in splits[1 : ( end - 1 ) ]], block. id)
380
378
end
381
379
382
380
# 2. Construct a map between the ID of each block and the ID associated to its split.
@@ -485,7 +483,10 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
485
483
deref_ids = map (phi_inds) do n
486
484
id = bb. inst_ids[n]
487
485
phi_id = phi_ids[n]
488
- push! (inst_pairs, (id, new_inst (Expr (:call , deref_phi, refs_id, phi_id))))
486
+ push! (
487
+ inst_pairs,
488
+ (id, new_inst (Expr (:call , deref_phi, refs_id, phi_id))),
489
+ )
489
490
return id
490
491
end
491
492
@@ -502,8 +503,8 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
502
503
# Iterate every statement in the split other than the final one, replacing uses
503
504
# of SSAs with de-referenced `Ref`s, and writing the results of statements to
504
505
# the corresponding `Ref`s.
505
- _ids = view (bb. inst_ids, split. start: (split. last - 1 ))
506
- _insts = view (bb. insts, split. start: (split. last - 1 ))
506
+ _ids = view (bb. inst_ids, ( split. start) : (split. last - 1 ))
507
+ _insts = view (bb. insts, ( split. start) : (split. last - 1 ))
507
508
for (id, inst) in zip (_ids, _insts)
508
509
stmt = inst. stmt
509
510
if Meta. isexpr (stmt, :invoke ) ||
@@ -515,17 +516,17 @@ function derive_copyable_task_ir(ir::BBCode)::Tuple{BBCode,Tuple}
515
516
# in the `Ref`s that they are associated to.
516
517
for (n, arg) in enumerate (stmt. args)
517
518
arg isa ID || continue
518
-
519
+
519
520
new_id = ID ()
520
521
ref_ind = ssa_id_to_ref_index_map[arg]
521
522
expr = Expr (:call , get_ref_at, refs_id, ref_ind)
522
523
push! (inst_pairs, (new_id, new_inst (expr)))
523
524
stmt. args[n] = new_id
524
525
end
525
-
526
+
526
527
# Push the target instruction to the list.
527
528
push! (inst_pairs, (id, inst))
528
-
529
+
529
530
# If we know it is not possible for this statement to contain any calls
530
531
# to produce, then simply write out the result to its `Ref`.
531
532
out_ind = ssa_id_to_ref_index_map[id]
0 commit comments