Although i32 type is illegal in llvm back-end, I don't think it necessory to keep consistent for layout string.
In the current version, layout string is "e-m:e-p:64:64-i64:64-i128:128-n64-S128" for 64-bit arch where native integer type is only i64. However, under this circumstance, some middle-end passes like LSRs may be influenced due to the predictor("DL.isLegalInteger") result.
Let's look at line 157-162 in IVUsers.cpp.
// LSR is not APInt clean, do not touch integers bigger than 64-bits. // Also avoid creating IVs of non-native types. For example, we don't want a // 64-bit IV in 32-bit code just because the loop has one 64-bit cast. uint64_t Width = SE->getTypeSizeInBits(I->getType()); if (Width > 64 || !DL.isLegalInteger(Width)) return false;
Now I try to use n32:64 in layout string without degression of some other passes that use this info.