brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.5 KiB · 34aa30f Raw
87 lines · plain
1; RUN: opt %s -passes='sroa,verify' -S -o - | FileCheck %s2 3; From:4; struct prog_src_register {5;   unsigned : 4;6;   int Index : 12 + 1;7;   unsigned : 12;8;   unsigned : 4;9;   int : 12 + 110; } src_reg_for_float() {11;   struct prog_src_register a;12;   memset(&a, 0, sizeof(a));13;   int local = a.Index;14;   return a;15; }16; ModuleID = 'pr22495.c'17target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"18target triple = "x86_64-unknown-linux-gnu"19 20; When SROA is creating new smaller allocas, it may add padding.21;22; There should be no debug info for the padding.23; CHECK-NOT: DW_OP_LLVM_fragment, 5624; CHECK: DIExpression(DW_OP_LLVM_fragment, 0, 32)25; CHECK-NOT: DW_OP_LLVM_fragment, 5626; CHECK: DIExpression(DW_OP_LLVM_fragment, 32, 24)27; CHECK-NOT: DW_OP_LLVM_fragment, 5628%struct.prog_src_register = type { i32, i24 }29 30; Function Attrs: nounwind31define i64 @src_reg_for_float() #0 !dbg !4 {32entry:33  %retval = alloca %struct.prog_src_register, align 434  %a = alloca %struct.prog_src_register, align 435  %local = alloca i32, align 436  call void @llvm.dbg.declare(metadata ptr %a, metadata !16, metadata !17), !dbg !1837  call void @llvm.memset.p0.i64(ptr align 4 %a, i8 0, i64 8, i1 false), !dbg !1938  call void @llvm.dbg.declare(metadata ptr %local, metadata !20, metadata !17), !dbg !2139  %bf.load = load i32, ptr %a, align 4, !dbg !2140  %bf.shl = shl i32 %bf.load, 15, !dbg !2141  %bf.ashr = ashr i32 %bf.shl, 19, !dbg !2142  store i32 %bf.ashr, ptr %local, align 4, !dbg !2143  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %retval, ptr align 4 %a, i64 8, i1 false), !dbg !2244  %0 = load i64, ptr %retval, align 1, !dbg !2245  ret i64 %0, !dbg !2246}47 48; Function Attrs: nounwind readnone49declare void @llvm.dbg.declare(metadata, metadata, metadata) #150 51; Function Attrs: nounwind52declare void @llvm.memset.p0.i64(ptr nocapture, i8, i64, i1) #253 54; Function Attrs: nounwind55declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture readonly, i64, i1) #256 57attributes #0 = { nounwind }58attributes #1 = { nounwind readnone }59attributes #2 = { nounwind }60 61!llvm.dbg.cu = !{!0}62!llvm.module.flags = !{!13, !14}63!llvm.ident = !{!15}64 65!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.7.0 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)66!1 = !DIFile(filename: "<stdin>", directory: "")67!2 = !{}68!4 = distinct !DISubprogram(name: "src_reg_for_float", line: 7, isLocal: false, isDefinition: true, isOptimized: false, unit: !0, scopeLine: 7, file: !5, scope: !6, type: !7, retainedNodes: !2)69!5 = !DIFile(filename: "pr22495.c", directory: "")70!6 = !DIFile(filename: "pr22495.c", directory: "")71!7 = !DISubroutineType(types: !8)72!8 = !{!9}73!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "prog_src_register", line: 1, size: 64, align: 32, file: !5, elements: !10)74!10 = !{!11}75!11 = !DIDerivedType(tag: DW_TAG_member, name: "Index", line: 3, size: 13, align: 32, offset: 4, file: !5, scope: !9, baseType: !12)76!12 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)77!13 = !{i32 2, !"Dwarf Version", i32 4}78!14 = !{i32 2, !"Debug Info Version", i32 3}79!15 = !{!"clang version 3.7.0 "}80!16 = !DILocalVariable(name: "a", line: 8, scope: !4, file: !6, type: !9)81!17 = !DIExpression()82!18 = !DILocation(line: 8, scope: !4)83!19 = !DILocation(line: 9, scope: !4)84!20 = !DILocalVariable(name: "local", line: 10, scope: !4, file: !6, type: !12)85!21 = !DILocation(line: 10, scope: !4)86!22 = !DILocation(line: 11, scope: !4)87