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

Backports for Julia 1.5-RC1 (or beta2) #36098

Merged
merged 29 commits into from
Jun 22, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a7c4fd3
fix #36031: Printf bug for BigInt (#36033)
simeonschaub May 28, 2020
91216bf
Update armv7l `-d16` -> `+d32` feature change for LLVM 9+
staticfloat May 28, 2020
53f0393
LibGit2: add resolve_url to RemoteCallbacksStruct for LibGit2 0.99.0 …
diabonas May 29, 2020
5e85387
update NEWS entry for popat!
rfourquet Jun 4, 2020
d01886d
Fix a bug with break/continue/return in at-testset begin end (#36046)
tkf Jun 1, 2020
c7476af
clarify `show` doc strings (#36076)
JeffBezanson Jun 1, 2020
99adb51
Revert "Use norm instead of abs in generic lu factorization (#34575)"…
andreasnoack Jun 2, 2020
3ccc916
rename pop!(vector, idx, [default]) to popat! (#36070)
rfourquet Jun 2, 2020
88b689b
fix #36116, diff(::AbstractRange) returns an Array (#36117)
mbauman Jun 3, 2020
539eab5
fix #36108, printing invalid numeric juxtapositions (#36122)
JeffBezanson Jun 3, 2020
633046e
Fix mkpath error handling (#36126)
simonbyrne Jun 3, 2020
360f5cc
fix #36104, assign global name during type definitions (#36121)
JeffBezanson Jun 4, 2020
fdd4547
Fix zero(::Type{<:TwicePrecision}) for dimensionful quantities (#36113)
sostock Jun 4, 2020
5c236b4
Fix equality for one-element ranges
sostock May 29, 2020
60bab00
fix ImmutableDict(pairs...) constructor (#36143)
rfourquet Jun 4, 2020
2f8eb20
inference: ignore badly behaving generated functions (#36115)
vtjnash Jun 3, 2020
62ea26d
Error when compiling invalid AddrSpacePtrs.
maleadt May 28, 2020
cf26388
Rename AddrSpacePtr to LLVMPtr.
maleadt May 28, 2020
bf34e0a
Mark Tuples with Bottom among their parameters as cacheable (#36152)
martinholters Jun 4, 2020
e4b83af
bump Pkg version
KristofferC Jun 5, 2020
3854131
bump Statistics version
KristofferC Jun 5, 2020
ea15599
Allow non-Function callables to be used in count(f, itr) (#36187)
tkf Jun 8, 2020
6c65ec8
fix #36272: Error with optional argument in anonymous function define…
simeonschaub Jun 15, 2020
8dec8f1
Fix Broadcasting of Bidiagonal (#35281)
ssikdar1 Jun 8, 2020
ee41310
Promote on Rational binary operations (#36279)
Liozou Jun 16, 2020
1cf4720
Remove `init` from `count!` docstring (#36305)
tkf Jun 16, 2020
e2cfc6f
deleteat! : check bounds for the first passed index (#36231)
rfourquet Jun 16, 2020
d3bc87f
Switch `httpbin` tests over to JuliaLang-hosted `httpbin` mock server…
staticfloat Jun 18, 2020
3e5174f
more precise inference of `splatnew` (#35976)
JeffBezanson May 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename AddrSpacePtr to LLVMPtr.
(cherry picked from commit a6354d9)
  • Loading branch information
maleadt authored and KristofferC committed Jun 4, 2020
commit cf26388cf561929386be261f1bb29cd4d5c906dc
12 changes: 8 additions & 4 deletions base/refpointer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@ setindex!(b::RefArray, x) = (b.x[b.i] = x; b)
###

"""
AddrSpacePtr{T, AS}
LLVMPtr{T, AS}

When passed as a `ccall` argument with the `llvmcall` calling convention, an `AddrSpacePtr` will be converted to an LLVM pointer type with the correct address space.
This type is mainly used to ensure Julia's codegen uses the correct address space when calling LLVM intrinsics.
A pointer type that more closely resembles LLVM semantics: It includes the pointer address
space, and will be passed as an actual pointer instead of an integer.

This type is mainly used to interface with code that has strict requirements about pointers,
e.g., intrinsics that are selected based on the address space, or back-ends that require
pointers to be identifiable by their types.
"""
Core.AddrSpacePtr
Core.LLVMPtr
2 changes: 1 addition & 1 deletion src/builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ void jl_init_primitives(void) JL_GC_DISABLED
add_builtin("CodeInfo", (jl_value_t*)jl_code_info_type);
add_builtin("Ref", (jl_value_t*)jl_ref_type);
add_builtin("Ptr", (jl_value_t*)jl_pointer_type);
add_builtin("AddrSpacePtr", (jl_value_t*)jl_addrspace_pointer_type);
add_builtin("LLVMPtr", (jl_value_t*)jl_llvmpointer_type);
add_builtin("Task", (jl_value_t*)jl_task_type);

add_builtin("AbstractArray", (jl_value_t*)jl_abstractarray_type);
Expand Down
2 changes: 1 addition & 1 deletion src/ccall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ std::string generate_func_sig(const char *fname)
t = T_pint8;
isboxed = false;
}
else if (llvmcall && jl_is_addrspace_ptr_type(tti)) {
else if (llvmcall && jl_is_llvmpointer_type(tti)) {
t = bitstype_to_llvm(tti, true);
tti = (jl_value_t*)jl_voidpointer_type;
isboxed = false;
Expand Down
2 changes: 1 addition & 1 deletion src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ static Type *bitstype_to_llvm(jl_value_t *bt, bool llvmcall = false)
return T_float32;
if (bt == (jl_value_t*)jl_float64_type)
return T_float64;
if (jl_is_addrspace_ptr_type(bt)) {
if (jl_is_llvmpointer_type(bt)) {
jl_value_t *as_param = jl_tparam1(bt);
int as;
if (jl_is_int32(as_param))
Expand Down
12 changes: 6 additions & 6 deletions src/jltypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ jl_datatype_t *jl_lineinfonode_type;
jl_unionall_t *jl_ref_type;
jl_unionall_t *jl_pointer_type;
jl_typename_t *jl_pointer_typename;
jl_unionall_t *jl_addrspace_pointer_type;
jl_typename_t *jl_addrspace_pointer_typename;
jl_unionall_t *jl_llvmpointer_type;
jl_typename_t *jl_llvmpointer_typename;
jl_datatype_t *jl_void_type; // deprecated
jl_datatype_t *jl_nothing_type;
jl_datatype_t *jl_voidpointer_type;
Expand Down Expand Up @@ -2240,14 +2240,14 @@ void jl_init_types(void) JL_GC_DISABLED
sizeof(void*)*8)->name->wrapper;
jl_pointer_typename = ((jl_datatype_t*)jl_unwrap_unionall((jl_value_t*)jl_pointer_type))->name;

// AddrSpacePtr{T, AS} where {T, AS}
// LLVMPtr{T, AS} where {T, AS}
tv = jl_svec2(tvar("T"), tvar("AS"));
jl_svec_t *tv_base = jl_svec1(tvar("T"));
jl_addrspace_pointer_type = (jl_unionall_t*)
jl_new_primitivetype((jl_value_t*)jl_symbol("AddrSpacePtr"), core,
jl_llvmpointer_type = (jl_unionall_t*)
jl_new_primitivetype((jl_value_t*)jl_symbol("LLVMPtr"), core,
(jl_datatype_t*)jl_apply_type((jl_value_t*)jl_ref_type, jl_svec_data(tv_base), 1), tv,
sizeof(void*)*8)->name->wrapper;
jl_addrspace_pointer_typename = ((jl_datatype_t*)jl_unwrap_unionall((jl_value_t*)jl_addrspace_pointer_type))->name;
jl_llvmpointer_typename = ((jl_datatype_t*)jl_unwrap_unionall((jl_value_t*)jl_llvmpointer_type))->name;

// Type{T} where T<:Tuple
tttvar = jl_new_typevar(jl_symbol("T"),
Expand Down
9 changes: 5 additions & 4 deletions src/julia.h
Original file line number Diff line number Diff line change
Expand Up @@ -635,10 +635,10 @@ extern JL_DLLEXPORT jl_datatype_t *jl_nothing_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_datatype_t *jl_signed_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_datatype_t *jl_voidpointer_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_unionall_t *jl_pointer_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_unionall_t *jl_addrspace_pointer_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_unionall_t *jl_llvmpointer_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_unionall_t *jl_ref_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_typename_t *jl_pointer_typename JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_typename_t *jl_addrspace_pointer_typename JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_typename_t *jl_llvmpointer_typename JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_typename_t *jl_namedtuple_typename JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_unionall_t *jl_namedtuple_type JL_GLOBALLY_ROOTED;
extern JL_DLLEXPORT jl_datatype_t *jl_task_type JL_GLOBALLY_ROOTED;
Expand Down Expand Up @@ -1088,6 +1088,7 @@ static inline int jl_is_layout_opaque(const jl_datatype_layout_t *l) JL_NOTSAFEP
#define jl_is_string(v) jl_typeis(v,jl_string_type)
#define jl_is_cpointer(v) jl_is_cpointer_type(jl_typeof(v))
#define jl_is_pointer(v) jl_is_cpointer_type(jl_typeof(v))
#define jl_is_llvmpointer(v) jl_typeis(v,jl_llvmpointer_type)
#define jl_is_intrinsic(v) jl_typeis(v,jl_intrinsic_type)
#define jl_array_isbitsunion(a) (!(((jl_array_t*)(a))->flags.ptrarray) && jl_is_uniontype(jl_tparam0(jl_typeof(a))))

Expand Down Expand Up @@ -1152,10 +1153,10 @@ STATIC_INLINE int jl_is_cpointer_type(jl_value_t *t) JL_NOTSAFEPOINT
((jl_datatype_t*)(t))->name == ((jl_datatype_t*)jl_pointer_type->body)->name);
}

STATIC_INLINE int jl_is_addrspace_ptr_type(jl_value_t *t) JL_NOTSAFEPOINT
STATIC_INLINE int jl_is_llvmpointer_type(jl_value_t *t) JL_NOTSAFEPOINT
{
return (jl_is_datatype(t) &&
((jl_datatype_t*)(t))->name == jl_addrspace_pointer_typename);
((jl_datatype_t*)(t))->name == jl_llvmpointer_typename);
}

STATIC_INLINE int jl_is_abstract_ref_type(jl_value_t *t) JL_NOTSAFEPOINT
Expand Down
4 changes: 2 additions & 2 deletions src/staticdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void *const _tags[] = {
&jl_linenumbernode_type, &jl_lineinfonode_type,
&jl_gotonode_type, &jl_quotenode_type,
&jl_pinode_type, &jl_phinode_type, &jl_phicnode_type, &jl_upsilonnode_type,
&jl_type_type, &jl_bottom_type, &jl_ref_type, &jl_pointer_type, &jl_addrspace_pointer_type,
&jl_type_type, &jl_bottom_type, &jl_ref_type, &jl_pointer_type, &jl_llvmpointer_type,
&jl_vararg_type, &jl_abstractarray_type,
&jl_densearray_type, &jl_nothing_type, &jl_function_type, &jl_typeofbottom_type,
&jl_unionall_type, &jl_typename_type, &jl_builtin_type, &jl_code_info_type,
Expand All @@ -57,7 +57,7 @@ static void *const _tags[] = {
&jl_float16_type, &jl_float32_type, &jl_float64_type, &jl_floatingpoint_type,
&jl_number_type, &jl_signed_type,
// special typenames
&jl_tuple_typename, &jl_pointer_typename, &jl_addrspace_pointer_typename, &jl_array_typename, &jl_type_typename,
&jl_tuple_typename, &jl_pointer_typename, &jl_llvmpointer_typename, &jl_array_typename, &jl_type_typename,
&jl_vararg_typename, &jl_namedtuple_typename,
&jl_vecelement_typename,
// special exceptions
Expand Down
2 changes: 1 addition & 1 deletion test/llvmpasses/llvmcall.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ emit(foo, NTuple{2, Float16})
emit(foo, NTuple{2, VecElement{Float16}})

# CHECK: call i8 addrspace(3)* @foo(i8 addrspace(3)* %{{[0-9]+}})
emit(foo, Core.AddrSpacePtr{Float32, 3})
emit(foo, Core.LLVMPtr{Float32, 3})

# CHECK: call { i32, i32 } @foo({ i32, i32 } %{{[0-9]+}})
emit(foo, Foo)
Expand Down