'Create an array structure reifying the given constant array.
A low-level contiguous array constant is created in the LLVM IR.'

def make_constant_array(self, builder, typ, ary):

    datatype = self.get_data_type(typ.dtype)
    size_limit = (10 ** 6)
    if (self.allow_dynamic_globals and ((typ.layout not in 'FC') or (ary.nbytes > size_limit))):
        dataptr = ary.ctypes.data
        data = self.add_dynamic_addr(builder, dataptr, info=str(type(dataptr)))
        rt_addr = self.add_dynamic_addr(builder, id(ary), info=str(type(ary)))
    else:
        flat = ary.flatten(order=typ.layout)
        consts = Constant.array(Type.int(8), bytearray(flat.data))
        data = cgutils.global_constant(builder, '.const.array.data', consts)
        data.align = self.get_abi_alignment(datatype)
        rt_addr = None
    llintp = self.get_value_type(types.intp)
    shapevals = [self.get_constant(types.intp, s) for s in ary.shape]
    cshape = Constant.array(llintp, shapevals)
    stridevals = [self.get_constant(types.intp, s) for s in ary.strides]
    cstrides = Constant.array(llintp, stridevals)
    cary = self.make_array(typ)(self, builder)
    intp_itemsize = self.get_constant(types.intp, ary.dtype.itemsize)
    self.populate_array(cary, data=builder.bitcast(data, cary.data.type), shape=cshape, strides=cstrides, itemsize=intp_itemsize, parent=rt_addr, meminfo=None)
    return cary._getvalue()
