diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h @@ -895,7 +895,7 @@ } /// Return a list of registers and their sizes. - SmallVector, 4> getRegsAndSizes() const; + SmallVector, 4> getRegsAndSizes() const; }; } // end namespace llvm diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -980,14 +980,14 @@ } } -SmallVector, 4> +SmallVector, 4> RegsForValue::getRegsAndSizes() const { - SmallVector, 4> OutVec; + SmallVector, 4> OutVec; unsigned I = 0; for (auto CountAndVT : zip_first(RegCount, RegVTs)) { unsigned RegCount = std::get<0>(CountAndVT); MVT RegisterVT = std::get<1>(CountAndVT); - unsigned RegisterSize = RegisterVT.getSizeInBits(); + TypeSize RegisterSize = RegisterVT.getSizeInBits(); for (unsigned E = I + RegCount; I != E; ++I) OutVec.push_back(std::make_pair(Regs[I], RegisterSize)); } @@ -5312,7 +5312,7 @@ // getUnderlyingArgRegs - Find underlying registers used for a truncated, // bitcasted, or split argument. Returns a list of static void -getUnderlyingArgRegs(SmallVectorImpl> &Regs, +getUnderlyingArgRegs(SmallVectorImpl> &Regs, const SDValue &N) { switch (N.getOpcode()) { case ISD::CopyFromReg: { @@ -5423,7 +5423,7 @@ if (FI != std::numeric_limits::max()) Op = MachineOperand::CreateFI(FI); - SmallVector, 8> ArgRegsAndSizes; + SmallVector, 8> ArgRegsAndSizes; if (!Op && N.getNode()) { getUnderlyingArgRegs(ArgRegsAndSizes, N); Register Reg; @@ -5453,8 +5453,8 @@ if (!Op) { // Create a DBG_VALUE for each decomposed value in ArgRegs to cover Reg - auto splitMultiRegDbgValue - = [&](ArrayRef> SplitRegs) { + auto splitMultiRegDbgValue = [&]( + ArrayRef> SplitRegs) { unsigned Offset = 0; for (auto RegAndSize : SplitRegs) { // If the expression is already a fragment, the current register diff --git a/llvm/test/CodeGen/AArch64/reproducer.ll b/llvm/test/CodeGen/AArch64/reproducer.ll new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/reproducer.ll @@ -0,0 +1,47 @@ +; RUN: llc -mtriple=aarch64-unknown-linux-gnu -mattr=+sve < %s 2>%t | FileCheck %s + +; RUN: FileCheck --check-prefix=WARN --allow-empty %s <%t + +; If this check fails please read +; clang/test/CodeGen/aarch64-sve-intrinsics/README for instructions on +; how to resolve it. + +; WARN-NOT: warning + +; CHECK-LABEL: do_something: +define @do_something( %vx) { +entry: + call void @llvm.dbg.value(metadata %vx, metadata !6, metadata !DIExpression()), !dbg !19 + %0 = tail call @xxx( %vx) + ret %0 + } + +declare @xxx() + +; Function Attrs: nofree nosync nounwind readnone speculatable willreturn +declare void @llvm.dbg.value(metadata, metadata, metadata) + +!llvm.dbg.cu = !{!0} +!llvm.module.flags = !{!3, !4} +!llvm.ident = !{!5} + +!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None) +!1 = !DIFile(filename: "file.c", directory: "/") +!2 = !{} +!3 = !{i32 7, !"Dwarf Version", i32 4} +!4 = !{i32 2, !"Debug Info Version", i32 3} +!5 = !{!"clang version 12.0.0"} +!6 = !DILocalVariable(name: "vx", arg: 1, scope: !7, file: !1, line: 3, type: !10) +!7 = distinct !DISubprogram(name: "do_something", scope: !1, file: !1, line: 3, type: !8, scopeLine: 3, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !17) +!8 = !DISubroutineType(types: !9) +!9 = !{!10} +!10 = !DIDerivedType(tag: DW_TAG_typedef, name: "svfloat64_t", file: !11, line: 56, baseType: !12) +!11 = !DIFile(filename: "arm_sve.h", directory: "/") +!12 = !DIDerivedType(tag: DW_TAG_typedef, name: "__SVFloat64_t", file: !1, baseType: !13) +!13 = !DICompositeType(tag: DW_TAG_array_type, baseType: !14, flags: DIFlagVector, elements: !15) +!14 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float) +!15 = !{!16} +!16 = !DISubrange(lowerBound: 0, upperBound: !DIExpression(DW_OP_constu, 1, DW_OP_bregx, 46, 0, DW_OP_mul, DW_OP_constu, 1, DW_OP_minus)) +!17 = !{!6, !18} +!18 = !DILocalVariable(name: "vout", scope: !7, file: !1, line: 4, type: !10) +!19 = !DILocation(line: 0, scope: !7)