@@ -1862,6 +1862,7 @@ static inline jl_cgval_t ghostValue(jl_codectx_t &ctx, jl_value_t *typ)
1862
1862
typ = (jl_value_t *)jl_typeofbottom_type->super ;
1863
1863
}
1864
1864
if (jl_is_type_type (typ)) {
1865
+ assert (is_uniquerep_Type (typ));
1865
1866
// replace T::Type{T} with T, by assuming that T must be a leaftype of some sort
1866
1867
jl_cgval_t constant (NULL , true , typ, NULL , best_tbaa (ctx.tbaa (), typ));
1867
1868
constant.constant = jl_tparam0 (typ);
@@ -1933,16 +1934,14 @@ static inline jl_cgval_t value_to_pointer(jl_codectx_t &ctx, const jl_cgval_t &v
1933
1934
1934
1935
static inline jl_cgval_t mark_julia_type (jl_codectx_t &ctx, Value *v, bool isboxed, jl_value_t *typ)
1935
1936
{
1936
- if (jl_is_datatype (typ) && jl_is_datatype_singleton ((jl_datatype_t *)typ)) {
1937
- // no need to explicitly load/store a constant/ghost value
1938
- return ghostValue (ctx, typ);
1939
- }
1940
1937
if (jl_is_type_type (typ)) {
1941
- jl_value_t *tp0 = jl_tparam0 (typ);
1942
- if (jl_is_concrete_type (tp0) || tp0 == jl_bottom_type) {
1938
+ if (is_uniquerep_Type (typ)) {
1943
1939
// replace T::Type{T} with T
1944
1940
return ghostValue (ctx, typ);
1945
1941
}
1942
+ } else if (jl_is_datatype (typ) && jl_is_datatype_singleton ((jl_datatype_t *)typ)) {
1943
+ // no need to explicitly load/store a constant/ghost value
1944
+ return ghostValue (ctx, typ);
1946
1945
}
1947
1946
Type *T = julia_type_to_llvm (ctx, typ);
1948
1947
if (type_is_ghost (T)) {
0 commit comments