File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ static bool hasObjref(Type *ty)
66
66
return ptrty->getAddressSpace () == AddressSpace::Tracked;
67
67
#if JL_LLVM_VERSION >= 110000
68
68
if (isa<ArrayType>(ty) || isa<VectorType>(ty))
69
- return GetElementPtrInst::getTypeAtIndex (ty, (uint64_t )0 );
69
+ return hasObjref ( GetElementPtrInst::getTypeAtIndex (ty, (uint64_t )0 ) );
70
70
#else
71
71
if (auto seqty = dyn_cast<SequentialType>(ty))
72
72
return hasObjref (seqty->getElementType ());
Original file line number Diff line number Diff line change
1
+ # This file is a part of Julia. License is MIT: https://julialang.org/license
2
+
3
+ # RUN: julia --startup-file=no %s %t -O
4
+ # RUN: cat %t/* | FileCheck %s
5
+
6
+ include (joinpath (" .." , " testhelpers" , " llvmpasses.jl" ))
7
+
8
+ # JuliaLang/julia#38922
9
+ function haszerolayout (x:: NTuple{32, VecElement{UInt8}} )
10
+ rx = Ref (x)
11
+ GC. @preserve rx begin
12
+ lower = iszero (unsafe_load (Ptr {UInt128} (pointer_from_objref (rx)), 1 ))
13
+ upper = iszero (unsafe_load (Ptr {UInt128} (pointer_from_objref (rx)), 2 ))
14
+ lower & upper
15
+ end
16
+ end
17
+
18
+ # CHECK-LABEL: @julia_haszerolayout
19
+ # CHECK: top:
20
+ # CHECK-NOT: @jl_gc_pool_alloc
21
+ # CHECK: extractelement
22
+ # CHECK: ret i8
23
+ emit (haszerolayout, NTuple{32 ,VecElement{UInt8}})
You can’t perform that action at this time.
0 commit comments