File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -751,6 +751,26 @@ function compile_method_instance(@nospecialize(job::CompilerJob))
751
751
compiled[mi] = (; ci, func= llvm_func, specfunc= llvm_specfunc)
752
752
end
753
753
754
+ # We don't control the interp that codegen constructs for us above.
755
+ # So we have to scan the IR manually.
756
+ for (mi, (ci:: CodeInstance , _, _)) in compiled
757
+ src = @atomic :monotonic ci. inferred
758
+ if src isa String
759
+ src = Core. Compiler. _uncompressed_ir (mi. def, src)
760
+ end
761
+ for expr in src. code
762
+ expr isa Expr || continue
763
+ if expr. head === :foreigncall &&
764
+ expr. args[1 ] == " extern gpuc.lookup"
765
+ deferred_mi = expr. args[6 ]
766
+ # Now push to a worklist and process...
767
+ # TODO : How do we deal with call duplication?
768
+ # Can we codegen into the same module, or do we merge?
769
+ # we can check against "compiled" to avoid recursion?
770
+ end
771
+ end
772
+ end
773
+
754
774
# ensure that the requested method instance was compiled
755
775
@assert haskey (compiled, job. source)
756
776
You can’t perform that action at this time.
0 commit comments