[clang] [Clang][AArch64][ARM]: Fix Inefficient loads/stores of _BitInt(N) (PR #93495)

Momchil Velikov via cfe-commits cfe-commits at lists.llvm.org
Tue May 28 10:31:10 PDT 2024


================
@@ -221,6 +221,16 @@ bool AArch64TargetInfo::validateTarget(DiagnosticsEngine &Diags) const {
   return true;
 }
 
+unsigned AArch64TargetInfo::getBitIntLegalWidth(unsigned Width) const {
----------------
momchil-velikov wrote:

This function is likely unnecessary (also it's incorrect in a couple of ways[1]). I think you should be using instead `ASTConext::getTypeInfo(T).Width`.

[1] Representation might be in less than 32-bits (could be also 8 or 16) and `_BitInt(N), N > 128` is not `N` bits wide, it's in multiples of `i128`.

https://github.com/llvm/llvm-project/pull/93495


More information about the cfe-commits mailing list