-
Notifications
You must be signed in to change notification settings - Fork 164
[CIR] Add builtin_setjmp codegen support #1842
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
Conversation
LLVM generated from default clang define dso_local void @_Z9BI_setjmpPPv(ptr noundef initializes((0, 8), (16, 24)) %env) local_unnamed_addr #0 !dbg !10 {
entry:
#dbg_value(ptr %env, !16, !DIExpression(), !17)
%0 = tail call ptr @llvm.frameaddress.p0(i32 0), !dbg !18
store ptr %0, ptr %env, align 8, !dbg !18
%1 = tail call ptr @llvm.stacksave.p0(), !dbg !18
%2 = getelementptr inbounds nuw i8, ptr %env, i64 16, !dbg !18
store ptr %1, ptr %2, align 8, !dbg !18
%3 = tail call i32 @llvm.eh.sjlj.setjmp(ptr nonnull %env), !dbg !18
ret void, !dbg !19
} LLVM generated from clangir clang define dso_local void @_Z9BI_setjmpPPv(ptr initializes((0, 16)) %0) local_unnamed_addr #0 !dbg !4 {
%2 = tail call ptr @llvm.frameaddress.p0(i32 0), !dbg !8
store ptr %2, ptr %0, align 8, !dbg !8
%3 = tail call ptr @llvm.stacksave.p0(), !dbg !8
%4 = getelementptr i8, ptr %0, i64 8, !dbg !8
store ptr %3, ptr %4, align 8, !dbg !8
%5 = tail call i32 @llvm.eh.sjlj.setjmp(ptr nonnull %0), !dbg !8
ret void, !dbg !9
} I'm not sure how the ptr stride op can generate the |
I can try for the setjmp in "setjmp.h" once i got my hands on a x86 linux, i'm not sure quite how to cross compile for x86_64 through llvm-lit and with x86_64's sysroot from a MacOS?! |
Closes #1807 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your first contribution and welcome to CIR! Some comments inline.
You should add |
the OG behavior defers BI_setjmp codegen to the predefined lib function codegen, the equivalent in CIR/ is
the latest commit replicates this behavior. I replicate the structure but didn't put up the actual implementation for MSVCRT. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the latest round of updates!
No description provided.