The IR builder hard-coded the type of the len argument of the memory function instrinsics to i64 for several builder functions.
During instruction selection of these intrinsics to the corresponding C library functions SelectionDAG ignores the type of the len argument and uses the targets preferred type.
GlobalISel however translates these calls using the actual types of the intrinsic, which will miscompile on 32-bit architectures.
Using the preferred type when creating the intrinsic call in the first place fixes this issue.
clang-format: please reformat the code