[clang] [llvm] [clang][DWARF] Add DW_AT_bit_stride for SVE predicate types (PR #161409)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 6 06:48:53 PDT 2025


================
@@ -902,7 +902,14 @@ llvm::DIType *CGDebugInfo::CreateType(const BuiltinType *BT) {
       // Debuggers can't extract 1bit from a vector, so will display a
       // bitpattern for predicates instead.
       unsigned NumElems = Info.EC.getKnownMinValue() * Info.NumVectors;
-      if (Info.ElementType == CGM.getContext().BoolTy) {
+      llvm::Metadata *BitStride = nullptr;
+      if (BT->getKind() == BuiltinType::SveBool) {
+        Info.ElementType = CGM.getContext().UnsignedCharTy;
+        BitStride = llvm::ConstantAsMetadata::get(llvm::ConstantInt::getSigned(
+            llvm::Type::getInt64Ty(CGM.getLLVMContext()), 1));
+      }
+
+      if (BT->getKind() == BuiltinType::SveCount) {
----------------
sdesmalen-arm wrote:

nit: this can be `else if`

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


More information about the llvm-commits mailing list