Skip to content
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

Bump to updated llvm 19 #105427

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

Conversation

radekdoulik
Copy link
Member

No description provided.

@radekdoulik
Copy link
Member Author

/azp run runtime-llvm

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radekdoulik
Copy link
Member Author

/azp run runtime-llvm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radekdoulik
Copy link
Member Author

/azp run runtime-llvm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@radekdoulik
Copy link
Member Author

/azp run runtime-llvm

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Co-authored-by: Alexander Köplinger <[email protected]>
@radekdoulik
Copy link
Member Author

The aot compiler fails when trying to register intrinsics

(gdb) bt
#0  0x0000aaaaab9a38a0 in DecodeFixedType(llvm::ArrayRef<llvm::Intrinsic::IITDescriptor>&, llvm::ArrayRef<llvm::Type*>, llvm::LLVMContext&) ()
#1  0x0000aaaaab9a3510 in llvm::Intrinsic::getType(llvm::LLVMContext&, unsigned int, llvm::ArrayRef<llvm::Type*>) ()
#2  0x0000aaaaab9a543c in llvm::Intrinsic::getDeclaration(llvm::Module*, unsigned int, llvm::ArrayRef<llvm::Type*>) ()
#3  0x0000aaaaab308eac in mono_llvm_register_intrinsic (module=0xaaaaabd22060, id=INTRINS_EH_TYPEID_FOR, out_type=0xffffffffd7f0) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm-cpp.cpp:717
#4  0x0000aaaaab2fe90c in add_intrinsic (ctx=0xaaaaabd36750, id=66) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:13843
#5  0x0000aaaaab2fe878 in get_overloaded_intrins (ctx=0xaaaaabd36750, id=66, overloaded_id=66) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:13951
#6  0x0000aaaaab2fe6ec in call_overloaded_intrins (ctx=0xaaaaabd36750, id=66, ovr_tag=0, args=0xffffffffda70, name=0xaaaaaab8d6b8 "") at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:5793
#7  0x0000aaaaab2fe188 in call_intrins (ctx=0xaaaaabd36750, id=66, args=0xffffffffda70, name=0xaaaaaab8d6b8 "") at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:5810
#8  0x0000aaaaab2ecf90 in emit_llvmonly_landing_pad (ctx=0xaaaaabd36750, group_index=0, group_size=1) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:5169
#9  0x0000aaaaab2e141c in emit_method_inner (ctx=0xaaaaabd36750) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:13412
#10 0x0000aaaaab2df1a0 in mono_llvm_emit_method (cfg=0xaaaaabd2c460) at /root/llvm/runtime/src/mono/mono/mini/mini-llvm.c:12869
#11 0x0000aaaaab0ed7ec in mini_method_compile (method=0xaaaaabc67228, opts=391195135, flags=(JIT_FLAG_AOT | JIT_FLAG_FULL_AOT | JIT_FLAG_LLVM | JIT_FLAG_EXPLICIT_NULL_CHECKS | JIT_FLAG_LLVM_ONLY | JIT_FLAG_INTERP), parts=0, aot_method_index=0)
    at /root/llvm/runtime/src/mono/mono/mini/mini.c:3927
#12 0x0000aaaaab1e31b8 in compile_method (acfg=0xaaaaabcdb9d0, method=0xaaaaabc67228) at /root/llvm/runtime/src/mono/mono/mini/aot-compiler.c:9586
#13 0x0000aaaaab1d960c in compile_methods (acfg=0xaaaaabcdb9d0) at /root/llvm/runtime/src/mono/mono/mini/aot-compiler.c:13194
#14 0x0000aaaaab1d3738 in aot_assembly (ass=0xaaaaabcdb070, jit_opts=374417919, aot_options=0xffffffffe890) at /root/llvm/runtime/src/mono/mono/mini/aot-compiler.c:15306
#15 0x0000aaaaab1d07c0 in mono_aot_assemblies (assemblies=0xaaaaabcdb3c0, nassemblies=1, jit_opts=374417919, runtime_args=0xaaaaabc53ce0, 
    aot_options=0xaaaaabc53f70 "no-opt,static,direct-icalls,deterministic,_child,mattr=simd,nodebug,llvm-path=/root/llvm/runtime/src/mono/browser/emsdk/bin/,static,dwarfdebug,dedup-skip,trimming-eligible-methods-outfile=/root/llvm/r"...)
    at /root/llvm/runtime/src/mono/mono/mini/aot-compiler.c:15860
#16 0x0000aaaaab1c6494 in main_thread_handler (user_data=0xffffffffed78) at /root/llvm/runtime/src/mono/mono/mini/driver.c:1423
#17 0x0000aaaaab1c26ac in mono_main (argc=5, argv=0xffffffffef98) at /root/llvm/runtime/src/mono/mono/mini/driver.c:2581
#18 0x0000aaaaaaed0178 in mono_main_with_options (argc=6, argv=0xffffffffef98) at /root/llvm/runtime/src/mono/mono/mini/main.c:36
#19 0x0000aaaaaaed0138 in main (argc=6, argv=0xffffffffef98) at /root/llvm/runtime/src/mono/mono/mini/main.c:88

This was hitting assert with debug version of llvm
The signature changed in dotnet/llvm-project@10edb4991c127

This fixes crash during registration of the intrinsic and the generated IR is now different.

Before:

    CATCHPAD0_BB4:                                    ; preds = %LPAD0_BB3
      %11 = catchpad within %10 [ptr @_ZTIPi]
      %12 = tail call ptr @llvm.wasm.get.exception(token %11)
      %13 = tail call i32 @llvm.wasm.get.ehselector(token %11)
      %14 = tail call i32 @llvm.eh.typeid.for(ptr @_ZTIPi)
      %15 = icmp eq i32 %13, %14
      br i1 %15, label %CATCH_BB5, label %NOCATCH_BB6

After:

    CATCHPAD0_BB4:                                    ; preds = %LPAD0_BB3
      %11 = catchpad within %10 [ptr @_ZTIPi]
      %12 = tail call ptr @llvm.wasm.get.exception(token %11)
      %13 = tail call i32 @llvm.wasm.get.ehselector(token %11)
      %14 = tail call i32 @llvm.eh.typeid.for.p0(ptr @_ZTIPi)
      %15 = icmp eq i32 %13, %14
      br i1 %15, label %CATCH_BB5, label %NOCATCH_BB6
Do not try to emit branch when target_bb is not set
That was catched by llvm debug asserts, the mask should be vector of 16 int8
To stop hitting assert in the verbose output, when aot compiler is built
with the debug configuration of llvm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants