[PATCH] D87358: [clang][aarch64] Fix ILP32 ABI for arm_sve_vector_bits

Cullen Rhodes via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 10 07:55:47 PDT 2020


c-rhodes added inline comments.


================
Comment at: clang/lib/AST/Type.cpp:2339
   case BuiltinType::SveInt32:
-    return Ctx.IntTy;
+    return IsILP32 ? Ctx.LongTy : Ctx.IntTy;
   case BuiltinType::SveUint32:
----------------
efriedma wrote:
> sdesmalen wrote:
> > Rather than comparing with a specific triple, how about getting the information from `TargetInfo`, i.e.
> > 
> >   case BuiltinType::SveInt32:
> >     Ctx.getTargetInfo().getLongWidth() == 32 ? Ctx.LongTy : Ctx.IntTy
> The type that actually corresponds to int64_t is TargetInfo::getInt64Type().  Not sure if you need that here.
I realised `ASTContext::getIntTypeForBitwidth` handles this and noticed `getBuiltinVectorTypeInfo` which Sander recently added makes use of it so I've updated it to use that instead for all types except predicates since we still need to represent them as i8.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87358/new/

https://reviews.llvm.org/D87358



More information about the cfe-commits mailing list