[PATCH] D136864: [Clang] Create opaque type for AArch64 SVE2p1/SME2 svcount_t.

Paul Walker via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 2 09:26:35 PST 2023


paulwalker-arm added inline comments.


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:730
       ASTContext::BuiltinVectorTypeInfo Info =
-          CGM.getContext().getBuiltinVectorTypeInfo(BT);
-      unsigned NumElemsPerVG = (Info.EC.getKnownMinValue() * Info.NumVectors) / 2;
+          // For svcount_t, only the lower 16 bits are relevant.
+          BT->getKind() == BuiltinType::SveCount
----------------
Given predicates are stored byte wise perhaps it's worth being more explicit and saying "only the first 2 bytes are relevant"?


================
Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:739
+      // bitpattern for predicates instead.
+      unsigned NumElems = Info.EC.getKnownMinValue() * Info.NumVectors;
       if (Info.ElementType == CGM.getContext().BoolTy) {
----------------
Do we need an assert that `Info.NumVectors` is 1 for `svcount_t`? I don't think we plan of having `svcountx2_t`, but if we did then I think this code is incorrect because `UpperBound` will not take the padding between the "live 16bit values" into account? And an assert would at least give us a modicum of protection.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D136864



More information about the cfe-commits mailing list