From 3a02a12faffe77cef9120c724e513d589a52d884 Mon Sep 17 00:00:00 2001 From: Jameson Nash Date: Wed, 15 Sep 2021 15:15:31 -0400 Subject: [PATCH] fixup! use separate names for internal and exported functions --- src/ccall.cpp | 4 ++-- test/llvmpasses/alloc-opt-gcframe.jl | 10 +++++----- test/llvmpasses/final-lower-gc.ll | 10 ++++------ test/llvmpasses/lower-handlers.ll | 6 +++--- test/llvmpasses/refinements.ll | 8 ++++---- 5 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/ccall.cpp b/src/ccall.cpp index 42efde0c99de8..631069d065fa0 100644 --- a/src/ccall.cpp +++ b/src/ccall.cpp @@ -1281,9 +1281,9 @@ static jl_cgval_t emit_ccall(jl_codectx_t &ctx, jl_value_t **args, size_t nargs) return false; #endif } - return f_name && (f_name == name || (name[0] == 'i' && f_name == name.drop_front())); + return f_name && f_name == name; }; -#define is_libjulia_func(name) _is_libjulia_func((uintptr_t)&(name), StringRef(XSTR(#name))) +#define is_libjulia_func(name) _is_libjulia_func((uintptr_t)&(name), StringRef(#name)) // emit arguments jl_cgval_t *argv = (jl_cgval_t*)alloca(sizeof(jl_cgval_t) * nccallargs); diff --git a/test/llvmpasses/alloc-opt-gcframe.jl b/test/llvmpasses/alloc-opt-gcframe.jl index 227569a545adb..b08e668e1a201 100644 --- a/test/llvmpasses/alloc-opt-gcframe.jl +++ b/test/llvmpasses/alloc-opt-gcframe.jl @@ -12,7 +12,7 @@ target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" # CHECK-LABEL: @return_obj # CHECK-NOT: @julia.gc_alloc_obj -# CHECK: %v = call noalias nonnull {} addrspace(10)* @jl_gc_pool_alloc +# CHECK: %v = call noalias nonnull {} addrspace(10)* @ijl_gc_pool_alloc # CHECK: store atomic {} addrspace(10)* @tag, {} addrspace(10)* addrspace(10)* {{.*}} unordered, align 8, !tbaa !0 println(""" define {} addrspace(10)* @return_obj() { @@ -52,7 +52,7 @@ define i64 @return_load(i64 %i) { # CHECK: call {}*** @julia.get_pgcstack() # CHECK: call {}*** @julia.ptls_states() # CHECK-NOT: @julia.gc_alloc_obj -# CHECK: @jl_gc_pool_alloc +# CHECK: @ijl_gc_pool_alloc # CHECK: store atomic {} addrspace(10)* @tag, {} addrspace(10)* addrspace(10)* {{.*}} unordered, align 8, !tbaa !0 println(""" define void @ccall_obj(i8* %fptr) { @@ -98,7 +98,7 @@ define void @ccall_ptr(i8* %fptr) { # CHECK: call {}*** @julia.get_pgcstack() # CHECK: call {}*** @julia.ptls_states() # CHECK-NOT: @julia.gc_alloc_obj -# CHECK: @jl_gc_pool_alloc +# CHECK: @ijl_gc_pool_alloc # CHECK: store atomic {} addrspace(10)* @tag, {} addrspace(10)* addrspace(10)* {{.*}} unordered, align 8, !tbaa !0 println(""" define void @ccall_unknown_bundle(i8* %fptr) { @@ -262,8 +262,8 @@ L3: """) # CHECK-LABEL: }{{$}} -# CHECK: declare noalias nonnull {} addrspace(10)* @jl_gc_pool_alloc(i8*, -# CHECK: declare noalias nonnull {} addrspace(10)* @jl_gc_big_alloc(i8*, +# CHECK: declare noalias nonnull {} addrspace(10)* @ijl_gc_pool_alloc(i8*, +# CHECK: declare noalias nonnull {} addrspace(10)* @ijl_gc_big_alloc(i8*, println(""" declare void @external_function() declare {}*** @julia.ptls_states() diff --git a/test/llvmpasses/final-lower-gc.ll b/test/llvmpasses/final-lower-gc.ll index e29ada14a0d00..6caf6dead7038 100644 --- a/test/llvmpasses/final-lower-gc.ll +++ b/test/llvmpasses/final-lower-gc.ll @@ -3,11 +3,9 @@ @tag = external addrspace(10) global {} declare void @boxed_simple({} addrspace(10)*, {} addrspace(10)*) -declare {} addrspace(10)* @jl_box_int64(i64) +declare {} addrspace(10)* @ijl_box_int64(i64) declare {}*** @julia.ptls_states() declare {}*** @julia.get_pgcstack() -declare void @jl_safepoint() -declare {} addrspace(10)* @jl_apply_generic({} addrspace(10)*, {} addrspace(10)**, i32) declare noalias nonnull {} addrspace(10)** @julia.new_gc_frame(i32) declare void @julia.push_gc_frame({} addrspace(10)**, i32) @@ -34,11 +32,11 @@ top: ; CHECK-DAG: [[GCFRAME_SLOT2:%.*]] = bitcast {}*** [[GCFRAME_SLOT]] to {} addrspace(10)*** ; CHECK-NEXT: store {} addrspace(10)** %gcframe, {} addrspace(10)*** [[GCFRAME_SLOT2]], align 8 call void @julia.push_gc_frame({} addrspace(10)** %gcframe, i32 2) - %aboxed = call {} addrspace(10)* @jl_box_int64(i64 signext %a) + %aboxed = call {} addrspace(10)* @ijl_box_int64(i64 signext %a) ; CHECK: %frame_slot_1 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)** %gcframe, i32 3 %frame_slot_1 = call {} addrspace(10)** @julia.get_gc_frame_slot({} addrspace(10)** %gcframe, i32 1) store {} addrspace(10)* %aboxed, {} addrspace(10)** %frame_slot_1, align 8 - %bboxed = call {} addrspace(10)* @jl_box_int64(i64 signext %b) + %bboxed = call {} addrspace(10)* @ijl_box_int64(i64 signext %b) ; CHECK: %frame_slot_2 = getelementptr inbounds {} addrspace(10)*, {} addrspace(10)** %gcframe, i32 2 %frame_slot_2 = call {} addrspace(10)** @julia.get_gc_frame_slot({} addrspace(10)** %gcframe, i32 0) store {} addrspace(10)* %bboxed, {} addrspace(10)** %frame_slot_2, align 8 @@ -59,7 +57,7 @@ top: %pgcstack = call {}*** @julia.get_pgcstack() %ptls = call {}*** @julia.ptls_states() %ptls_i8 = bitcast {}*** %ptls to i8* -; CHECK: %v = call noalias nonnull {} addrspace(10)* @jl_gc_pool_alloc +; CHECK: %v = call noalias nonnull {} addrspace(10)* @ijl_gc_pool_alloc %v = call {} addrspace(10)* @julia.gc_alloc_bytes(i8* %ptls_i8, i64 8) %0 = bitcast {} addrspace(10)* %v to {} addrspace(10)* addrspace(10)* %1 = getelementptr {} addrspace(10)*, {} addrspace(10)* addrspace(10)* %0, i64 -1 diff --git a/test/llvmpasses/lower-handlers.ll b/test/llvmpasses/lower-handlers.ll index d9d5ac087b773..4191fa664c6cd 100644 --- a/test/llvmpasses/lower-handlers.ll +++ b/test/llvmpasses/lower-handlers.ll @@ -2,7 +2,7 @@ attributes #1 = { returns_twice } declare i32 @julia.except_enter() #1 -declare void @jl_pop_handler(i32) +declare void @ijl_pop_handler(i32) declare i8**** @julia.ptls_states() declare i8**** @julia.get_pgcstack() @@ -10,7 +10,7 @@ define void @simple() { top: %pgcstack = call i8**** @julia.get_pgcstack() ; CHECK: call void @llvm.lifetime.start -; CHECK: call void @jl_enter_handler +; CHECK: call void @ijl_enter_handler ; CHECK: setjmp %r = call i32 @julia.except_enter() %cmp = icmp eq i32 %r, 0 @@ -20,7 +20,7 @@ try: catch: br label %after after: - call void @jl_pop_handler(i32 1) + call void @ijl_pop_handler(i32 1) ; CHECK: llvm.lifetime.end ret void } diff --git a/test/llvmpasses/refinements.ll b/test/llvmpasses/refinements.ll index b883a53554a0c..40dd020bca260 100644 --- a/test/llvmpasses/refinements.ll +++ b/test/llvmpasses/refinements.ll @@ -5,7 +5,7 @@ declare {}*** @julia.ptls_states() declare {}*** @julia.get_pgcstack() declare void @jl_safepoint() declare void @one_arg_boxed({} addrspace(10)*) -declare {} addrspace(10)* @jl_box_int64(i64) +declare {} addrspace(10)* @ijl_box_int64(i64) define void @argument_refinement({} addrspace(10)* %a) { ; CHECK-LABEL: @argument_refinement @@ -26,7 +26,7 @@ define void @heap_refinement1(i64 %a) { ; CHECK: %gcframe = alloca {} addrspace(10)*, i32 3 %pgcstack = call {}*** @julia.get_pgcstack() %ptls = call {}*** @julia.ptls_states() - %aboxed = call {} addrspace(10)* @jl_box_int64(i64 signext %a) + %aboxed = call {} addrspace(10)* @ijl_box_int64(i64 signext %a) %casted1 = bitcast {} addrspace(10)* %aboxed to {} addrspace(10)* addrspace(10)* %loaded1 = load {} addrspace(10)*, {} addrspace(10)* addrspace(10)* %casted1, !tbaa !1 ; CHECK: store {} addrspace(10)* %aboxed @@ -43,7 +43,7 @@ define void @heap_refinement2(i64 %a) { ; CHECK: %gcframe = alloca {} addrspace(10)*, i32 3 %pgcstack = call {}*** @julia.get_pgcstack() %ptls = call {}*** @julia.ptls_states() - %aboxed = call {} addrspace(10)* @jl_box_int64(i64 signext %a) + %aboxed = call {} addrspace(10)* @ijl_box_int64(i64 signext %a) %casted1 = bitcast {} addrspace(10)* %aboxed to {} addrspace(10)* addrspace(10)* %loaded1 = load {} addrspace(10)*, {} addrspace(10)* addrspace(10)* %casted1, !tbaa !1 ; CHECK: store {} addrspace(10)* %loaded1 @@ -211,7 +211,7 @@ declare void @julia.write_barrier({} addrspace(10)*, {} addrspace(10)*) #1 define {} addrspace(10)* @setfield({} addrspace(10)* %p) { ; CHECK-LABEL: @setfield( ; CHECK-NOT: %gcframe -; CHECK: call void @jl_gc_queue_root +; CHECK: call void @ijl_gc_queue_root %pgcstack = call {}*** @julia.get_pgcstack() %ptls = call {}*** @julia.ptls_states() %c = call {} addrspace(10)* @allocate_some_value()