Instead of calling ConstantFoldConstant inside the asm printer, use
foldConstantForPrint(), which can be customized per-target.
(Also, fix printing null pointers of size > 64 bits.)
The motivating example for this change is the expression
ptr addrspace(7) addrcast(ptr null to ptr addrspace(7)) on AMDGPU once
address space 7 has been set to an accurate 128-bit length, which is a
change that will occur in a future commit.
The null pointer will be cast to a 128-bit "null descriptor", that is,
i128 0. However, 128-bit values do not fit into MCExpr, and cause
crashes when passed to emitIntValue(). Therefore, we add this constant
folding hook to allow the AMDGPU target to fix up the relevant address
space cast.
Don't understand why you can't unconditionally call emitZeros. Compatibility is not a concern with the codegen APIs