For variables in generic address spaces, for example:
unsigned char V[6442450944]; ...
the address space is not yet known when we get into *getConstantArrayType*, it is 0. AMDGCN target's address space 0 has 32 bits pointers, so when we call *getPointerWidth* with 0, the array size is trimmed to 32 bits, which is not right.
Can we just use getMaxPointerWidth instead? If we cannot determine the pointer size, using max pointer size makes sense. Also can you add a ToDo comment about this. Ideally we could get a better fix later.