julia icon indicating copy to clipboard operation
julia copied to clipboard

choice to Target ISA in @code_llvm and @code_native

Open arhik opened this issue 1 year ago • 2 comments

attempts to address issue #52949

arhik avatar May 28 '24 04:05 arhik

I've made some attempts based on v1.11.0-beta1. After specifying the new parameters, it is now possible to generate native code for wasm64 in my local environment. https://github.com/inkydragon/julia/commit/66e09cb3e15d2a3de99e3d973511640aec7f6c5b

  • In addition to the codes mentioned in the issue, I also modified the following code to use a specific ISA https://github.com/JuliaLang/julia/blob/0bf392e671b5b0a889043b386e00ca11d6eed4d1/src/aotcompile.cpp#L2022 https://github.com/JuliaLang/julia/blob/0bf392e671b5b0a889043b386e00ca11d6eed4d1/src/disasm.cpp#L1247
  • You need to initialize all supported architectures: InitializeAll*s();
  • It seems that by default LLVM only supports the following architectures. (v1.11 + LLVM 16.0.6 + WSL/Win11). Perhaps we need to specify some compilation options to make LLVM support all platforms supported by julia
    / llvm/Config/Targets.def
    LVM_TARGET(AMDGPU)
    LVM_TARGET(NVPTX)
    LVM_TARGET(WebAssembly)
    LVM_TARGET(BPF)
    LVM_TARGET(AVR)
    LVM_TARGET(X86)
    

inkydragon avatar May 28 '24 23:05 inkydragon

Reminder to myself for eventual review. We need to make sure that the results are not leaked into the compilation cache. https://discourse.julialang.org/t/any-existing-efforts-on-cross-compiling-julia-programs-across-different-platforms/118253/3?u=vchuravy

vchuravy avatar Aug 16 '24 13:08 vchuravy