brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.6 KiB · eb98428 Raw
102 lines · plain
1; RUN: opt %s -S -passes=sroa -o - | FileCheck %s2 3;; Ensure that only the value-expression gets fragment info; that the4;; address-expression remains untouched.5 6;; $ cat test.cpp7;; class a {8;;   float b[4];9;; };10;; class c {11;;   a m_fn1() const;12;;   void d() const;13;; };14;; void c::d() const { a e = m_fn1(); }15;;16;; Generated by grabbing IR before sroa in:17;; $ clang++ -O2 -g -c test.cpp -Xclang  -fexperimental-assignment-tracking18 19; CHECK: %call = call20; CHECK-NEXT: %0 = extractvalue { <2 x float>, <2 x float> } %call, 021; CHECK-NEXT: #dbg_value(<2 x float> %0, ![[var:[0-9]+]], !DIExpression(DW_OP_LLVM_fragment, 0, 64),22; CHECK-NEXT: %1 = extractvalue { <2 x float>, <2 x float> } %call, 123; CHECK-NEXT: #dbg_value(<2 x float> %1, ![[var]], !DIExpression(DW_OP_LLVM_fragment, 64, 64),24 25%class.c = type { i8 }26%class.a = type { [4 x float] }27 28; Function Attrs: uwtable29define dso_local void @_ZNK1c1dEv(ptr %this) #0 align 2 !dbg !7 {30entry:31  %this.addr = alloca ptr, align 8, !DIAssignID !2932  call void @llvm.dbg.assign(metadata i1 undef, metadata !26, metadata !DIExpression(), metadata !29, metadata ptr %this.addr, metadata !DIExpression()), !dbg !3033  %e = alloca %class.a, align 4, !DIAssignID !3134  call void @llvm.dbg.assign(metadata i1 undef, metadata !28, metadata !DIExpression(), metadata !31, metadata ptr %e, metadata !DIExpression()), !dbg !3035  store ptr %this, ptr %this.addr, align 8, !DIAssignID !3636  call void @llvm.dbg.assign(metadata ptr %this, metadata !26, metadata !DIExpression(), metadata !36, metadata ptr %this.addr, metadata !DIExpression()), !dbg !3037  %this1 = load ptr, ptr %this.addr, align 838  %0 = bitcast ptr %e to ptr, !dbg !3739  %call = call { <2 x float>, <2 x float> } @_ZNK1c5m_fn1Ev(ptr %this1), !dbg !3840  %coerce.dive = getelementptr inbounds %class.a, ptr %e, i32 0, i32 0, !dbg !3841  %1 = bitcast ptr %coerce.dive to ptr, !dbg !3842  %2 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %1, i32 0, i32 0, !dbg !3843  %3 = extractvalue { <2 x float>, <2 x float> } %call, 0, !dbg !3844  store <2 x float> %3, ptr %2, align 4, !dbg !38, !DIAssignID !3945  call void @llvm.dbg.assign(metadata <2 x float> %3, metadata !28, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64), metadata !39, metadata ptr %2, metadata !DIExpression()), !dbg !3046  %4 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %1, i32 0, i32 1, !dbg !3847  %5 = extractvalue { <2 x float>, <2 x float> } %call, 1, !dbg !3848  store <2 x float> %5, ptr %4, align 4, !dbg !38, !DIAssignID !4049  call void @llvm.dbg.assign(metadata <2 x float> %5, metadata !28, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64), metadata !40, metadata ptr %4, metadata !DIExpression()), !dbg !3050  %6 = bitcast ptr %e to ptr, !dbg !4151  ret void, !dbg !4152}53 54declare void @llvm.dbg.declare(metadata, metadata, metadata) #155declare dso_local { <2 x float>, <2 x float> } @_ZNK1c5m_fn1Ev(ptr) #356declare void @llvm.dbg.assign(metadata, metadata, metadata, metadata, metadata, metadata) #157 58 59!llvm.dbg.cu = !{!0}60!llvm.module.flags = !{!3, !4, !5, !1000}61!llvm.ident = !{!6}62 63!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 12.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)64!1 = !DIFile(filename: "test.cpp", directory: "/")65!2 = !{}66!3 = !{i32 7, !"Dwarf Version", i32 4}67!4 = !{i32 2, !"Debug Info Version", i32 3}68!5 = !{i32 1, !"wchar_size", i32 4}69!6 = !{!"clang version 12.0.0"}70!7 = distinct !DISubprogram(name: "d", linkageName: "_ZNK1c1dEv", scope: !8, file: !1, line: 8, type: !23, scopeLine: 8, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, declaration: !22, retainedNodes: !25)71!8 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "c", file: !1, line: 4, size: 8, flags: DIFlagTypePassByValue, elements: !9, identifier: "_ZTS1c")72!9 = !{!10, !22}73!10 = !DISubprogram(name: "m_fn1", linkageName: "_ZNK1c5m_fn1Ev", scope: !8, file: !1, line: 5, type: !11, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)74!11 = !DISubroutineType(types: !12)75!12 = !{!13, !20}76!13 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "a", file: !1, line: 1, size: 128, flags: DIFlagTypePassByValue, elements: !14, identifier: "_ZTS1a")77!14 = !{!15}78!15 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !13, file: !1, line: 2, baseType: !16, size: 128)79!16 = !DICompositeType(tag: DW_TAG_array_type, baseType: !17, size: 128, elements: !18)80!17 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float)81!18 = !{!19}82!19 = !DISubrange(count: 4)83!20 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)84!21 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)85!22 = !DISubprogram(name: "d", linkageName: "_ZNK1c1dEv", scope: !8, file: !1, line: 6, type: !23, scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized)86!23 = !DISubroutineType(types: !24)87!24 = !{null, !20}88!25 = !{!26, !28}89!26 = !DILocalVariable(name: "this", arg: 1, scope: !7, type: !27, flags: DIFlagArtificial | DIFlagObjectPointer)90!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64)91!28 = !DILocalVariable(name: "e", scope: !7, file: !1, line: 8, type: !13)92!29 = distinct !DIAssignID()93!30 = !DILocation(line: 0, scope: !7)94!31 = distinct !DIAssignID()95!36 = distinct !DIAssignID()96!37 = !DILocation(line: 8, column: 21, scope: !7)97!38 = !DILocation(line: 8, column: 27, scope: !7)98!39 = distinct !DIAssignID()99!40 = distinct !DIAssignID()100!41 = !DILocation(line: 8, column: 36, scope: !7)101!1000 = !{i32 7, !"debug-info-assignment-tracking", i1 true}102