llvm.org GIT mirror llvm / 6c1dec6
Re-Revert r257105 (Verifier debug info changes) While I investigate some new buildbot failures. This was originally reapplied as r257550 and r257558. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257563 91177308-0d34-0410-b5e6-96231b3b80d8 Keno Fischer 3 years ago
38 changed file(s) with 210 addition(s) and 280 deletion(s). Raw diff Collapse all Expand all
2020 //
2121 //===----------------------------------------------------------------------===//
2222
23 #include "llvm/CodeGen/Passes.h"
2324 #include "llvm/ADT/BitVector.h"
2425 #include "llvm/ADT/DepthFirstIterator.h"
2526 #include "llvm/ADT/PostOrderIterator.h"
3839 #include "llvm/CodeGen/MachineMemOperand.h"
3940 #include "llvm/CodeGen/MachineModuleInfo.h"
4041 #include "llvm/CodeGen/MachineRegisterInfo.h"
41 #include "llvm/CodeGen/Passes.h"
4242 #include "llvm/CodeGen/PseudoSourceValue.h"
4343 #include "llvm/CodeGen/SlotIndexes.h"
4444 #include "llvm/CodeGen/StackProtector.h"
4747 #include "llvm/IR/Dominators.h"
4848 #include "llvm/IR/Function.h"
4949 #include "llvm/IR/Instructions.h"
50 #include "llvm/IR/IntrinsicInst.h"
5150 #include "llvm/IR/Module.h"
5251 #include "llvm/Support/CommandLine.h"
5352 #include "llvm/Support/Debug.h"
495494 // upcoming replacement.
496495 SP->adjustForColoring(From, To);
497496
498 // The new alloca might not be valid in a llvm.dbg.declare for this
499 // variable, so undef out the use to make the verifier happy.
500 AllocaInst *FromAI = const_cast(From);
501 if (FromAI->isUsedByMetadata())
502 ValueAsMetadata::handleRAUW(FromAI, UndefValue::get(FromAI->getType()));
503 for (auto &Use : FromAI->uses()) {
504 if (BitCastInst *BCI = dyn_cast(Use.get()))
505 if (BCI->isUsedByMetadata())
506 ValueAsMetadata::handleRAUW(BCI, UndefValue::get(BCI->getType()));
507 }
508
509497 // Note that this will not replace uses in MMOs (which we'll update below),
510498 // or anywhere else (which is why we won't delete the original
511499 // instruction).
512 FromAI->replaceAllUsesWith(Inst);
500 const_cast(From)->replaceAllUsesWith(Inst);
513501 }
514502
515503 // Remap all instructions to the new stack slots.
445445 // Module-level debug info verification...
446446 void verifyTypeRefs();
447447 template
448 void verifyDIExpression(const DbgInfoIntrinsic &I, const MapTy &TypeRefs);
448 void verifyBitPieceExpression(const DbgInfoIntrinsic &I,
449 const MapTy &TypeRefs);
449450 void visitUnresolvedTypeRef(const MDString *S, const MDNode *N);
450451 };
451452 } // End anonymous namespace
40864087 }
40874088
40884089 template
4089 void Verifier::verifyDIExpression(const DbgInfoIntrinsic &I,
4090 const MapTy &TypeRefs) {
4090 void Verifier::verifyBitPieceExpression(const DbgInfoIntrinsic &I,
4091 const MapTy &TypeRefs) {
40914092 DILocalVariable *V;
40924093 DIExpression *E;
4093 const Value *Arg;
4094 uint64_t ArgumentTypeSizeInBits = 0;
40954094 if (auto *DVI = dyn_cast(&I)) {
4096 Arg = DVI->getValue();
4097 if (Arg)
4098 ArgumentTypeSizeInBits =
4099 M->getDataLayout().getTypeAllocSizeInBits(Arg->getType());
41004095 V = dyn_cast_or_null(DVI->getRawVariable());
41014096 E = dyn_cast_or_null(DVI->getRawExpression());
41024097 } else {
41034098 auto *DDI = cast(&I);
4104 // For declare intrinsics, get the total size of the alloca, to allow
4105 // case where the variable may span more than one element.
4106 Arg = DDI->getAddress();
4107 if (Arg)
4108 Arg = Arg->stripPointerCasts();
4109 const AllocaInst *AI = dyn_cast_or_null(Arg);
4110 if (AI) {
4111 // We can only say something about constant size allocations
4112 if (const ConstantInt *CI = dyn_cast(AI->getArraySize()))
4113 ArgumentTypeSizeInBits =
4114 CI->getLimitedValue() *
4115 M->getDataLayout().getTypeAllocSizeInBits(AI->getAllocatedType());
4116 }
41174099 V = dyn_cast_or_null(DDI->getRawVariable());
41184100 E = dyn_cast_or_null(DDI->getRawExpression());
41194101 }
41204102
41214103 // We don't know whether this intrinsic verified correctly.
41224104 if (!V || !E || !E->isValid())
4105 return;
4106
4107 // Nothing to do if this isn't a bit piece expression.
4108 if (!E->isBitPiece())
41234109 return;
41244110
41254111 // The frontend helps out GDB by emitting the members of local anonymous
41374123 if (!VarSize)
41384124 return;
41394125
4140 if (E->isBitPiece()) {
4141 unsigned PieceSize = E->getBitPieceSize();
4142 unsigned PieceOffset = E->getBitPieceOffset();
4143 Assert(PieceSize + PieceOffset <= VarSize,
4144 "piece is larger than or outside of variable", &I, V, E);
4145 Assert(PieceSize != VarSize, "piece covers entire variable", &I, V, E);
4146 return;
4147 }
4148
4149 if (!ArgumentTypeSizeInBits)
4150 return; // We were unable to determine the size of the argument
4151
4152 if (E->getNumElements() == 0) {
4153 // In the case where the expression is empty, verify the size of the
4154 // argument. Doing this in the general case would require looking through
4155 // any dereferences that may be in the expression.
4156 Assert(ArgumentTypeSizeInBits == VarSize,
4157 "size of passed value (" + utostr(ArgumentTypeSizeInBits) +
4158 ") does not match size of declared variable (" +
4159 utostr(VarSize) + ")",
4160 &I, Arg, V, V->getType(), E);
4161 } else if (E->getElement(0) == dwarf::DW_OP_deref) {
4162 Assert(ArgumentTypeSizeInBits == M->getDataLayout().getPointerSizeInBits(),
4163 "the operation of the expression is a deref, but the passed value "
4164 "is not pointer sized",
4165 &I, Arg, V, V->getType(), E);
4166 }
4126 unsigned PieceSize = E->getBitPieceSize();
4127 unsigned PieceOffset = E->getBitPieceOffset();
4128 Assert(PieceSize + PieceOffset <= VarSize,
4129 "piece is larger than or outside of variable", &I, V, E);
4130 Assert(PieceSize != VarSize, "piece covers entire variable", &I, V, E);
41674131 }
41684132
41694133 void Verifier::visitUnresolvedTypeRef(const MDString *S, const MDNode *N) {
41964160 for (const BasicBlock &BB : F)
41974161 for (const Instruction &I : BB)
41984162 if (auto *DII = dyn_cast(&I))
4199 verifyDIExpression(*DII, TypeRefs);
4163 verifyBitPieceExpression(*DII, TypeRefs);
42004164
42014165 // Return early if all typerefs were resolved.
42024166 if (UnresolvedTypeRefs.empty())
0 ; RUN: llc -O0 -mtriple=arm-apple-darwin < %s | grep DW_OP_breg
11 ; Use DW_OP_breg in variable's location expression if the variable is in a stack slot.
2
3 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:64"
4 target triple = "arm-apple-darwin"
52
63 %struct.SVal = type { i8*, i32 }
74
8077 !llvm.module.flags = !{!49}
8178
8279 !0 = !DISubprogram(name: "SVal", line: 11, isLocal: false, isDefinition: false, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !14)
83 !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", line: 1, size: 64, align: 64, file: !48, elements: !4)
80 !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", line: 1, size: 128, align: 64, file: !48, elements: !4)
8481 !2 = !DIFile(filename: "small.cc", directory: "/Users/manav/R8248330")
8582 !3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: false, emissionKind: 1, file: !48, enums: !47, retainedTypes: !47, subprograms: !46, globals: !47, imports: !47)
8683 !4 = !{!5, !7, !0, !9}
105102 !23 = !DILocalVariable(name: "i", line: 16, arg: 1, scope: !17, file: !2, type: !13)
106103 !24 = !DILocation(line: 16, scope: !17)
107104 !25 = !DILocalVariable(name: "location", line: 16, arg: 2, scope: !17, file: !2, type: !26)
108 !26 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", size: 32, align: 32, file: !48, scope: !2, baseType: !1)
105 !26 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", size: 64, align: 64, file: !48, scope: !2, baseType: !1)
109106 !27 = !DILocation(line: 17, scope: !28)
110107 !28 = distinct !DILexicalBlock(line: 16, column: 0, file: !2, scope: !17)
111108 !29 = !DILocation(line: 18, scope: !28)
112109 !30 = !DILocation(line: 20, scope: !28)
113110 !31 = !DILocalVariable(name: "this", line: 11, arg: 1, scope: !16, file: !2, type: !32)
114 !32 = !DIDerivedType(tag: DW_TAG_const_type, flags: DIFlagArtificial, file: !48, scope: !2, baseType: !33)
115 !33 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, file: !48, scope: !2, baseType: !1)
111 !32 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !48, scope: !2, baseType: !33)
112 !33 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !48, scope: !2, baseType: !1)
116113 !34 = !DILocation(line: 11, scope: !16)
117114 !35 = !DILocation(line: 11, scope: !36)
118115 !36 = distinct !DILexicalBlock(line: 11, column: 0, file: !48, scope: !37)
55 entry:
66 %x.i = alloca i8, align 1
77 %y.i = alloca [256 x i8], align 16
8 %0 = bitcast i8* %x.i to i8*
8 %0 = bitcast [256 x i8]* %y.i to i8*
99 br label %for.body
1010
1111 for.body:
3434 !1 = !DIFile(filename: "t.c", directory: "")
3535 !2 = !{}
3636 !3 = !{i32 1, !"Debug Info Version", i32 3}
37 !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !9)
37 !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !6)
3838 !5 = distinct !DISubprogram(scope: null, isLocal: false, isDefinition: true, isOptimized: false)
3939 !6 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
4040 !7 = !DIExpression()
4141 !8 = !DILocation(line: 0, scope: !5)
42 !9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !6, size: 2048, align: 8, elements: !10)
43 !10 = !{!11}
44 !11 = !DISubrange(count: 256)
4542 ...
4643 ---
4744 name: foo
5249 # CHECK-LABEL: foo
5350 # CHECK: stack:
5451 # CHECK: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
55 # CHECK-NEXT: di-expression: '!10', di-location: '!11' }
52 # CHECK-NEXT: di-expression: '!7', di-location: '!8' }
5653 stack:
5754 - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
5855 di-expression: '!7', di-location: '!8' }
3939 !1 = !{!2}
4040 !2 = distinct !DISubprogram(name: "test", isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !6, scope: !5, type: !7)
4141 !3 = !DILocalVariable(name: "callback", line: 214, scope: !2, type: !4)
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "btCompoundLeafCallback", line: 90, size: 64, align: 64, file: !6)
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "btCompoundLeafCallback", line: 90, size: 512, align: 64, file: !6)
4343 !5 = !DIFile(filename: "MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", directory: "MultiSource/Benchmarks/Bullet")
4444 !6 = !DIFile(filename: "MultiSource/Benchmarks/Bullet/btCompoundCollisionAlgorithm.cpp", directory: "MultiSource/Benchmarks/Bullet")
4545 !7 = !DISubroutineType(types: !9)
3535 !5 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3636 !6 = !DILocalVariable(name: "i", line: 2, arg: 1, scope: !1, file: !2, type: !5)
3737 !7 = !DILocalVariable(name: "c", line: 2, arg: 2, scope: !1, file: !2, type: !8)
38 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !0, baseType: !5)
38 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !0, baseType: !9)
3939 !9 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
40 !10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !5)
40 !10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !9)
4141 !11 = distinct !DILexicalBlock(line: 2, column: 25, file: !20, scope: !1)
4242 !12 = !DILocation(line: 2, column: 13, scope: !1)
4343 !13 = !DILocation(line: 2, column: 22, scope: !1)
1111 ; CHECK: je .LBB0_4
1212
1313 ; Regenerate test with this command:
14 ; clang++ -emit-llvm -S -O2 -g
14 ; clang -emit-llvm -S -O2 -g
1515 ; from this source:
1616 ;
1717 ; extern void foo(char *dst,unsigned siz,const char *src);
4343 %struct.AAA3 = type { [4 x i8] }
4444
4545 @.str = private unnamed_addr constant [1 x i8] zeroinitializer, align 1
46 @.str.1 = private unnamed_addr constant [2 x i8] c"+\00", align 1
47 @.str.2 = private unnamed_addr constant [2 x i8] c"-\00", align 1
46 @.str1 = private unnamed_addr constant [2 x i8] c"+\00", align 1
47 @.str2 = private unnamed_addr constant [2 x i8] c"-\00", align 1
4848
4949 ; Function Attrs: uwtable
5050 define void @_Z3barii(i32 %param1, i32 %param2) #0 !dbg !24 {
5151 entry:
5252 %var1 = alloca %struct.AAA3, align 1
5353 %var2 = alloca %struct.AAA3, align 1
54 tail call void @llvm.dbg.value(metadata i32 %param1, i64 0, metadata !29, metadata !46), !dbg !47
55 tail call void @llvm.dbg.value(metadata i32 %param2, i64 0, metadata !30, metadata !46), !dbg !48
56 tail call void @llvm.dbg.value(metadata i8* null, i64 0, metadata !31, metadata !46), !dbg !49
54 tail call void @llvm.dbg.value(metadata i32 %param1, i64 0, metadata !30, metadata !DIExpression()), !dbg !47
55 tail call void @llvm.dbg.value(metadata i32 %param2, i64 0, metadata !31, metadata !DIExpression()), !dbg !47
56 tail call void @llvm.dbg.value(metadata i8* null, i64 0, metadata !32, metadata !DIExpression()), !dbg !49
5757 %tobool = icmp eq i32 %param2, 0, !dbg !50
58 br i1 %tobool, label %if.end, label %if.then, !dbg !52
58 br i1 %tobool, label %if.end, label %if.then, !dbg !50
5959
6060 if.then: ; preds = %entry
61 %call = tail call i8* @_Z5i2stri(i32 %param2), !dbg !53
62 tail call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata !31, metadata !46), !dbg !49
63 br label %if.end, !dbg !55
61 %call = tail call i8* @_Z5i2stri(i32 %param2), !dbg !52
62 tail call void @llvm.dbg.value(metadata i8* %call, i64 0, metadata !32, metadata !DIExpression()), !dbg !49
63 br label %if.end, !dbg !54
6464
6565 if.end: ; preds = %entry, %if.then
66 %0 = getelementptr inbounds %struct.AAA3, %struct.AAA3* %var1, i64 0, i32 0, i64 0, !dbg !56
67 call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !56
68 tail call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !32, metadata !57), !dbg !58
69 tail call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !36, metadata !46), !dbg !59
70 tail call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 0, metadata !38, metadata !46), !dbg !62
71 call void @_Z3fooPcjPKc(i8* %0, i32 4, i8* nonnull getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !63
72 %1 = getelementptr inbounds %struct.AAA3, %struct.AAA3* %var2, i64 0, i32 0, i64 0, !dbg !65
73 call void @llvm.lifetime.start(i64 4, i8* %1) #4, !dbg !65
74 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !33, metadata !57), !dbg !66
75 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !36, metadata !46), !dbg !67
76 call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 0, metadata !38, metadata !46), !dbg !69
77 call void @_Z3fooPcjPKc(i8* %1, i32 4, i8* nonnull getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !70
78 %tobool1 = icmp eq i32 %param1, 0, !dbg !71
79 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !33, metadata !57), !dbg !66
80 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !41, metadata !46), !dbg !73
81 br i1 %tobool1, label %if.else, label %if.then2, !dbg !75
66 tail call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !33, metadata !DIExpression()), !dbg !55
67 tail call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !56, metadata !DIExpression()), !dbg !57
68 tail call void @llvm.dbg.value(metadata !58, i64 0, metadata !59, metadata !DIExpression()), !dbg !60
69 %arraydecay.i = getelementptr inbounds %struct.AAA3, %struct.AAA3* %var1, i64 0, i32 0, i64 0, !dbg !61
70 call void @_Z3fooPcjPKc(i8* %arraydecay.i, i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !61
71 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !34, metadata !DIExpression()), !dbg !63
72 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !64, metadata !DIExpression()), !dbg !65
73 call void @llvm.dbg.value(metadata !58, i64 0, metadata !66, metadata !DIExpression()), !dbg !67
74 %arraydecay.i5 = getelementptr inbounds %struct.AAA3, %struct.AAA3* %var2, i64 0, i32 0, i64 0, !dbg !68
75 call void @_Z3fooPcjPKc(i8* %arraydecay.i5, i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !68
76 %tobool1 = icmp eq i32 %param1, 0, !dbg !69
77 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !34, metadata !DIExpression()), !dbg !63
78 br i1 %tobool1, label %if.else, label %if.then2, !dbg !69
8279
8380 if.then2: ; preds = %if.end
84 call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i64 0, metadata !42, metadata !46), !dbg !76
85 call void @_Z3fooPcjPKc(i8* %1, i32 4, i8* nonnull getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)), !dbg !78
86 br label %if.end3, !dbg !79
81 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !71, metadata !DIExpression()), !dbg !73
82 call void @llvm.dbg.value(metadata !74, i64 0, metadata !75, metadata !DIExpression()), !dbg !76
83 call void @_Z3fooPcjPKc(i8* %arraydecay.i5, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str1, i64 0, i64 0)), !dbg !76
84 br label %if.end3, !dbg !72
8785
8886 if.else: ; preds = %if.end
89 call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i64 0, metadata !42, metadata !46), !dbg !80
90 call void @_Z3fooPcjPKc(i8* %1, i32 4, i8* nonnull getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)), !dbg !81
87 call void @llvm.dbg.value(metadata %struct.AAA3* %var2, i64 0, metadata !77, metadata !DIExpression()), !dbg !79
88 call void @llvm.dbg.value(metadata !80, i64 0, metadata !81, metadata !DIExpression()), !dbg !82
89 call void @_Z3fooPcjPKc(i8* %arraydecay.i5, i32 4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str2, i64 0, i64 0)), !dbg !82
9190 br label %if.end3
9291
9392 if.end3: ; preds = %if.else, %if.then2
94 call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !32, metadata !57), !dbg !58
95 call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !41, metadata !46), !dbg !82
96 call void @llvm.dbg.value(metadata i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i64 0, metadata !42, metadata !46), !dbg !84
97 call void @_Z3fooPcjPKc(i8* %0, i32 4, i8* nonnull getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !85
98 call void @llvm.lifetime.end(i64 4, i8* %1) #4, !dbg !86
99 call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !87
100 ret void, !dbg !86
93 call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !33, metadata !DIExpression()), !dbg !55
94 call void @llvm.dbg.value(metadata %struct.AAA3* %var1, i64 0, metadata !83, metadata !DIExpression()), !dbg !85
95 call void @llvm.dbg.value(metadata !58, i64 0, metadata !86, metadata !DIExpression()), !dbg !87
96 call void @_Z3fooPcjPKc(i8* %arraydecay.i, i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)), !dbg !87
97 ret void, !dbg !88
10198 }
10299
103 ; Function Attrs: argmemonly nounwind
104 declare void @llvm.lifetime.start(i64, i8* nocapture) #1
105
106 declare i8* @_Z5i2stri(i32) #2
107
108 ; Function Attrs: argmemonly nounwind
109 declare void @llvm.lifetime.end(i64, i8* nocapture) #1
110
111 declare void @_Z3fooPcjPKc(i8*, i32, i8*) #2
100 declare i8* @_Z5i2stri(i32) #1
101
102 declare void @_Z3fooPcjPKc(i8*, i32, i8*) #1
112103
113104 ; Function Attrs: nounwind readnone
114 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #3
115
116 attributes #0 = { uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
117 attributes #1 = { argmemonly nounwind }
118 attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2" "unsafe-fp-math"="false" "use-soft-float"="false" }
119 attributes #3 = { nounwind readnone }
120 attributes #4 = { nounwind }
105 declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2
106
107 attributes #0 = { uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
108 attributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
109 attributes #2 = { nounwind readnone }
121110
122111 !llvm.dbg.cu = !{!0}
123 !llvm.module.flags = !{!43, !44}
124 !llvm.ident = !{!45}
125
126 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0 (trunk 255993) (llvm/trunk 256074)", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !23)
127 !1 = !DIFile(filename: "test.cpp", directory: "/mnt/extra")
112 !llvm.module.flags = !{!44, !45}
113 !llvm.ident = !{!46}
114
115 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.5.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !23, globals: !2, imports: !2)
116 !1 = !DIFile(filename: "dbg-changes-codegen-branch-folding.cpp", directory: "/tmp/dbginfo")
128117 !2 = !{}
129118 !3 = !{!4}
130 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "AAA3", file: !1, line: 4, size: 32, align: 8, elements: !5, identifier: "_ZTS4AAA3")
119 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "AAA3", line: 4, size: 32, align: 8, file: !1, elements: !5, identifier: "_ZTS4AAA3")
131120 !5 = !{!6, !11, !17, !18}
132 !6 = !DIDerivedType(tag: DW_TAG_member, name: "text", scope: !"_ZTS4AAA3", file: !1, line: 8, baseType: !7, size: 32, align: 8)
133 !7 = !DICompositeType(tag: DW_TAG_array_type, baseType: !8, size: 32, align: 8, elements: !9)
134 !8 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
121 !6 = !DIDerivedType(tag: DW_TAG_member, name: "text", line: 8, size: 32, align: 8, file: !1, scope: !"_ZTS4AAA3", baseType: !7)
122 !7 = !DICompositeType(tag: DW_TAG_array_type, size: 32, align: 8, baseType: !8, elements: !9)
123 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
135124 !9 = !{!10}
136125 !10 = !DISubrange(count: 4)
137 !11 = !DISubprogram(name: "AAA3", scope: !"_ZTS4AAA3", file: !1, line: 5, type: !12, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true)
126 !11 = !DISubprogram(name: "AAA3", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !"_ZTS4AAA3", type: !12)
138127 !12 = !DISubroutineType(types: !13)
139128 !13 = !{null, !14, !15}
140 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS4AAA3", size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
141 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, align: 64)
129 !14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS4AAA3")
130 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16)
142131 !16 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)
143 !17 = !DISubprogram(name: "operator=", linkageName: "_ZN4AAA3aSEPKc", scope: !"_ZTS4AAA3", file: !1, line: 6, type: !12, isLocal: false, isDefinition: false, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true)
144 !18 = !DISubprogram(name: "operator const char *", linkageName: "_ZNK4AAA3cvPKcEv", scope: !"_ZTS4AAA3", file: !1, line: 7, type: !19, isLocal: false, isDefinition: false, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true)
132 !17 = !DISubprogram(name: "operator=", linkageName: "_ZN4AAA3aSEPKc", line: 6, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !"_ZTS4AAA3", type: !12)
133 !18 = !DISubprogram(name: "operator const char *", linkageName: "_ZNK4AAA3cvPKcEv", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !1, scope: !"_ZTS4AAA3", type: !19)
145134 !19 = !DISubroutineType(types: !20)
146135 !20 = !{!15, !21}
147 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !22, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
136 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !22)
148137 !22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS4AAA3")
149 !23 = !{!24, !34, !39}
150 !24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barii", scope: !1, file: !1, line: 11, type: !25, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, variables: !28)
151 !25 = !DISubroutineType(types: !26)
152 !26 = !{null, !27, !27}
153 !27 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
154 !28 = !{!29, !30, !31, !32, !33}
155 !29 = !DILocalVariable(name: "param1", arg: 1, scope: !24, file: !1, line: 11, type: !27)
156 !30 = !DILocalVariable(name: "param2", arg: 2, scope: !24, file: !1, line: 11, type: !27)
157 !31 = !DILocalVariable(name: "temp", scope: !24, file: !1, line: 12, type: !15)
158 !32 = !DILocalVariable(name: "var1", scope: !24, file: !1, line: 17, type: !"_ZTS4AAA3")
159 !33 = !DILocalVariable(name: "var2", scope: !24, file: !1, line: 18, type: !"_ZTS4AAA3")
160 !34 = distinct !DISubprogram(name: "AAA3", linkageName: "_ZN4AAA3C2EPKc", scope: !"_ZTS4AAA3", file: !1, line: 5, type: !12, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, declaration: !11, variables: !35)
161 !35 = !{!36, !38}
162 !36 = !DILocalVariable(name: "this", arg: 1, scope: !34, type: !37, flags: DIFlagArtificial | DIFlagObjectPointer)
163 !37 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS4AAA3", size: 64, align: 64)
164 !38 = !DILocalVariable(name: "value", arg: 2, scope: !34, file: !1, line: 5, type: !15)
165 !39 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN4AAA3aSEPKc", scope: !"_ZTS4AAA3", file: !1, line: 6, type: !12, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: true, declaration: !17, variables: !40)
166 !40 = !{!41, !42}
167 !41 = !DILocalVariable(name: "this", arg: 1, scope: !39, type: !37, flags: DIFlagArtificial | DIFlagObjectPointer)
168 !42 = !DILocalVariable(name: "value", arg: 2, scope: !39, file: !1, line: 6, type: !15)
169 !43 = !{i32 2, !"Dwarf Version", i32 4}
170 !44 = !{i32 2, !"Debug Info Version", i32 3}
171 !45 = !{!"clang version 3.8.0 (trunk 255993) (llvm/trunk 256074)"}
172 !46 = !DIExpression()
173 !47 = !DILocation(line: 11, column: 15, scope: !24)
174 !48 = !DILocation(line: 11, column: 26, scope: !24)
175 !49 = !DILocation(line: 12, column: 16, scope: !24)
176 !50 = !DILocation(line: 14, column: 7, scope: !51)
177 !51 = distinct !DILexicalBlock(scope: !24, file: !1, line: 14, column: 7)
178 !52 = !DILocation(line: 14, column: 7, scope: !24)
179 !53 = !DILocation(line: 15, column: 12, scope: !54)
180 !54 = distinct !DILexicalBlock(scope: !51, file: !1, line: 14, column: 15)
181 !55 = !DILocation(line: 16, column: 3, scope: !54)
182 !56 = !DILocation(line: 17, column: 3, scope: !24)
183 !57 = !DIExpression(DW_OP_deref)
184 !58 = !DILocation(line: 17, column: 8, scope: !24)
185 !59 = !DILocation(line: 0, scope: !34, inlinedAt: !60)
186 !60 = distinct !DILocation(line: 17, column: 8, scope: !61)
187 !61 = !DILexicalBlockFile(scope: !24, file: !1, discriminator: 1)
188 !62 = !DILocation(line: 5, column: 19, scope: !34, inlinedAt: !60)
189 !63 = !DILocation(line: 5, column: 28, scope: !64, inlinedAt: !60)
190 !64 = distinct !DILexicalBlock(scope: !34, file: !1, line: 5, column: 26)
191 !65 = !DILocation(line: 18, column: 3, scope: !24)
192 !66 = !DILocation(line: 18, column: 8, scope: !24)
193 !67 = !DILocation(line: 0, scope: !34, inlinedAt: !68)
194 !68 = distinct !DILocation(line: 18, column: 8, scope: !61)
195 !69 = !DILocation(line: 5, column: 19, scope: !34, inlinedAt: !68)
196 !70 = !DILocation(line: 5, column: 28, scope: !64, inlinedAt: !68)
197 !71 = !DILocation(line: 20, column: 7, scope: !72)
198 !72 = distinct !DILexicalBlock(scope: !24, file: !1, line: 20, column: 7)
199 !73 = !DILocation(line: 0, scope: !39, inlinedAt: !74)
200 !74 = distinct !DILocation(line: 23, column: 10, scope: !72)
201 !75 = !DILocation(line: 20, column: 7, scope: !24)
202 !76 = !DILocation(line: 6, column: 29, scope: !39, inlinedAt: !77)
203 !77 = distinct !DILocation(line: 21, column: 10, scope: !72)
204 !78 = !DILocation(line: 6, column: 38, scope: !39, inlinedAt: !77)
205 !79 = !DILocation(line: 21, column: 5, scope: !72)
206 !80 = !DILocation(line: 6, column: 29, scope: !39, inlinedAt: !74)
207 !81 = !DILocation(line: 6, column: 38, scope: !39, inlinedAt: !74)
208 !82 = !DILocation(line: 0, scope: !39, inlinedAt: !83)
209 !83 = distinct !DILocation(line: 24, column: 8, scope: !24)
210 !84 = !DILocation(line: 6, column: 29, scope: !39, inlinedAt: !83)
211 !85 = !DILocation(line: 6, column: 38, scope: !39, inlinedAt: !83)
212 !86 = !DILocation(line: 25, column: 1, scope: !24)
213 !87 = !DILocation(line: 25, column: 1, scope: !61)
138 !23 = !{!24, !35, !40}
139 !24 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barii", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !1, scope: !25, type: !26, variables: !29)
140 !25 = !DIFile(filename: "dbg-changes-codegen-branch-folding.cpp", directory: "/tmp/dbginfo")
141 !26 = !DISubroutineType(types: !27)
142 !27 = !{null, !28, !28}
143 !28 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
144 !29 = !{!30, !31, !32, !33, !34}
145 !30 = !DILocalVariable(name: "param1", line: 11, arg: 1, scope: !24, file: !25, type: !28)
146 !31 = !DILocalVariable(name: "param2", line: 11, arg: 2, scope: !24, file: !25, type: !28)
147 !32 = !DILocalVariable(name: "temp", line: 12, scope: !24, file: !25, type: !15)
148 !33 = !DILocalVariable(name: "var1", line: 17, scope: !24, file: !25, type: !"_ZTS4AAA3")
149 !34 = !DILocalVariable(name: "var2", line: 18, scope: !24, file: !25, type: !"_ZTS4AAA3")
150 !35 = distinct !DISubprogram(name: "operator=", linkageName: "_ZN4AAA3aSEPKc", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !1, scope: !"_ZTS4AAA3", type: !12, declaration: !17, variables: !36)
151 !36 = !{!37, !39}
152 !37 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, type: !38)
153 !38 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4AAA3")
154 !39 = !DILocalVariable(name: "value", line: 6, arg: 2, scope: !35, file: !25, type: !15)
155 !40 = distinct !DISubprogram(name: "AAA3", linkageName: "_ZN4AAA3C2EPKc", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !1, scope: !"_ZTS4AAA3", type: !12, declaration: !11, variables: !41)
156 !41 = !{!42, !43}
157 !42 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !40, type: !38)
158 !43 = !DILocalVariable(name: "value", line: 5, arg: 2, scope: !40, file: !25, type: !15)
159 !44 = !{i32 2, !"Dwarf Version", i32 4}
160 !45 = !{i32 2, !"Debug Info Version", i32 3}
161 !46 = !{!"clang version 3.5.0 "}
162 !47 = !DILocation(line: 11, scope: !24)
163 !48 = !{i8* null}
164 !49 = !DILocation(line: 12, scope: !24)
165 !50 = !DILocation(line: 14, scope: !51)
166 !51 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !24)
167 !52 = !DILocation(line: 15, scope: !53)
168 !53 = distinct !DILexicalBlock(line: 14, column: 0, file: !1, scope: !51)
169 !54 = !DILocation(line: 16, scope: !53)
170 !55 = !DILocation(line: 17, scope: !24)
171 !56 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !40, type: !38)
172 !57 = !DILocation(line: 0, scope: !40, inlinedAt: !55)
173 !58 = !{i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)}
174 !59 = !DILocalVariable(name: "value", line: 5, arg: 2, scope: !40, file: !25, type: !15)
175 !60 = !DILocation(line: 5, scope: !40, inlinedAt: !55)
176 !61 = !DILocation(line: 5, scope: !62, inlinedAt: !55)
177 !62 = distinct !DILexicalBlock(line: 5, column: 0, file: !1, scope: !40)
178 !63 = !DILocation(line: 18, scope: !24)
179 !64 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !40, type: !38)
180 !65 = !DILocation(line: 0, scope: !40, inlinedAt: !63)
181 !66 = !DILocalVariable(name: "value", line: 5, arg: 2, scope: !40, file: !25, type: !15)
182 !67 = !DILocation(line: 5, scope: !40, inlinedAt: !63)
183 !68 = !DILocation(line: 5, scope: !62, inlinedAt: !63)
184 !69 = !DILocation(line: 20, scope: !70)
185 !70 = distinct !DILexicalBlock(line: 20, column: 0, file: !1, scope: !24)
186 !71 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, type: !38)
187 !72 = !DILocation(line: 21, scope: !70)
188 !73 = !DILocation(line: 0, scope: !35, inlinedAt: !72)
189 !74 = !{i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str1, i64 0, i64 0)}
190 !75 = !DILocalVariable(name: "value", line: 6, arg: 2, scope: !35, file: !25, type: !15)
191 !76 = !DILocation(line: 6, scope: !35, inlinedAt: !72)
192 !77 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, type: !38)
193 !78 = !DILocation(line: 23, scope: !70)
194 !79 = !DILocation(line: 0, scope: !35, inlinedAt: !78)
195 !80 = !{i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str2, i64 0, i64 0)}
196 !81 = !DILocalVariable(name: "value", line: 6, arg: 2, scope: !35, file: !25, type: !15)
197 !82 = !DILocation(line: 6, scope: !35, inlinedAt: !78)
198 !83 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !35, type: !38)
199 !84 = !DILocation(line: 24, scope: !24)
200 !85 = !DILocation(line: 0, scope: !35, inlinedAt: !84)
201 !86 = !DILocalVariable(name: "value", line: 6, arg: 2, scope: !35, file: !25, type: !15)
202 !87 = !DILocation(line: 6, scope: !35, inlinedAt: !84)
203 !88 = !DILocation(line: 25, scope: !24)
5959 !14 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_extended", line: 3, file: !5, baseType: !15)
6060 !15 = !DIDerivedType(tag: DW_TAG_typedef, name: "fpu_register", line: 2, file: !5, baseType: !16)
6161 !16 = !DIDerivedType(tag: DW_TAG_typedef, name: "uae_f64", line: 1, file: !5, baseType: !17)
62 !17 = !DIBasicType(tag: DW_TAG_base_type, name: "long double", size: 128, align: 128, encoding: DW_ATE_float)
62 !17 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
6363 !18 = !DILocalVariable(name: "a", line: 15, scope: !4, file: !6, type: !19)
6464 !19 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
6565 !20 = !DILocalVariable(name: "value", line: 16, scope: !4, file: !6, type: !14)
4848 %0 = load i8, i8* @argc, align 1
4949 tail call void @llvm.dbg.value(metadata i8 %0, i64 0, metadata !19, metadata !29), !dbg !DILocation(scope: !13)
5050 %conv = sext i8 %0 to i32
51 tail call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !DILocation(scope: !13)
51 tail call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !29), !dbg !DILocation(scope: !13)
5252 %call = call i32 (%class.C*, i8, i8, i8, ...) @test_function(%class.C* %c, i8 signext 0, i8 signext %0, i8 signext 0, i32 %conv)
5353 %1 = load i8, i8* @argc, align 1
54 call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !DILocation(scope: !13)
54 call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !29), !dbg !DILocation(scope: !13)
5555 %call2 = call i32 (%class.C*, i8, i8, i8, ...) @test_function(%class.C* %c, i8 signext 0, i8 signext %1, i8 signext 0, i32 %conv)
5656 ret void
5757 }
238238 !76 = !DIExpression(DW_OP_bit_piece, 8, 120)
239239 !77 = !DILocation(line: 17, column: 12, scope: !31, inlinedAt: !75)
240240 !78 = !DIExpression(DW_OP_bit_piece, 136, 56)
241 !79 = !DIExpression(DW_OP_deref)
241 !79 = !DIExpression()
242242 !80 = !DILocation(line: 19, column: 5, scope: !34)
243243 !81 = !DILocation(line: 20, column: 7, scope: !34)
244244 !82 = !DILocation(line: 20, column: 5, scope: !34)
2424 %this_addr = alloca %struct.S* ; <%struct.S**> [#uses=1]
2525 %retval = alloca i32 ; [#uses=1]
2626 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
27 call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression(DW_OP_deref)), !dbg !21
27 call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression()), !dbg !21
2828 store %struct.S* %this, %struct.S** %this_addr
2929 br label %return, !dbg !21
3030
5656 !15 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !9)
5757 !16 = !DILocation(line: 3, scope: !1)
5858 !17 = !DILocation(line: 3, scope: !3)
59 ; Modified from being a pointer, to make this testcase independent of target pointer size
60 !18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !9)
59 !18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !19)
6160 !19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
6261 !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
6362 !21 = !DILocation(line: 3, scope: !12)
4141 %a = alloca %class.A, align 1 ; <%class.A*> [#uses=1]
4242 %i = alloca i32, align 4 ; [#uses=2]
4343 store %class.A* %this, %class.A** %this.addr
44 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
44 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression()), !dbg !18
4545 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
4646 call void @llvm.dbg.declare(metadata %class.A* %a, metadata !19, metadata !DIExpression()), !dbg !27
4747 call void @llvm.dbg.declare(metadata i32* %i, metadata !28, metadata !DIExpression()), !dbg !29
5858 %retval = alloca i32, align 4 ; [#uses=2]
5959 %this.addr = alloca %class.A*, align 8 ; <%class.A**> [#uses=2]
6060 store %class.A* %this, %class.A** %this.addr
61 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression(DW_OP_deref)), !dbg !34
61 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression()), !dbg !34
6262 %this1 = load %class.A*, %class.A** %this.addr ; <%class.A*> [#uses=0]
6363 store i32 42, i32* %retval, !dbg !35
6464 %0 = load i32, i32* %retval, !dbg !35 ; [#uses=1]
8686 !14 = !DILocation(line: 16, column: 5, scope: !1)
8787 !15 = !DILocation(line: 17, column: 3, scope: !1)
8888 !16 = !DILocation(line: 18, column: 1, scope: !2)
89 ; Manually modified to avoid pointers (thus dependence on pointer size) in Generic test
90 !17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !8)
89 !17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !13)
9190 !18 = !DILocation(line: 4, column: 7, scope: !10)
9291 !19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21)
9392 !20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10)
103102 !30 = !DILocation(line: 10, column: 5, scope: !20)
104103 !31 = !DILocation(line: 11, column: 5, scope: !20)
105104 !32 = !DILocation(line: 12, column: 3, scope: !10)
106 ; Manually modified like !17 above
107 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !21)
105 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !26)
108106 !34 = !DILocation(line: 7, column: 11, scope: !23)
109107 !35 = !DILocation(line: 7, column: 19, scope: !36)
110108 !36 = distinct !DILexicalBlock(line: 7, column: 17, file: !38, scope: !23)
55 entry:
66 %userUPP_addr = alloca void (%struct.AppleEvent*)* ; [#uses=1]
77 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
8 call void @llvm.dbg.declare(metadata void (%struct.AppleEvent*)** %userUPP_addr, metadata !0, metadata !DIExpression(DW_OP_deref)), !dbg !13
8 call void @llvm.dbg.declare(metadata void (%struct.AppleEvent*)** %userUPP_addr, metadata !0, metadata !DIExpression()), !dbg !13
99 store void (%struct.AppleEvent*)* %userUPP, void (%struct.AppleEvent*)** %userUPP_addr
1010 br label %return, !dbg !14
1111
2323 !3 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build 9999)", isOptimized: true, emissionKind: 0, file: !16, enums: !17, retainedTypes: !17, subprograms: !18)
2424 !4 = !DISubroutineType(types: !5)
2525 !5 = !{null, !6}
26 ; Manually modified to avoid dependence on pointer size in generic test
27 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !8)
26 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !7)
2827 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !8)
2928 !8 = !DISubroutineType(types: !9)
3029 !9 = !{null, !10}
2727 call void @llvm.dbg.value(metadata !6, i64 0, metadata !15, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
2828 call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !19, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !16)
2929 call void @llvm.dbg.declare(metadata !6, metadata !23, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
30 call void @llvm.dbg.value(metadata i64* %data_addr.i17, i64 0, metadata !34, metadata !DIExpression(DW_OP_deref)) nounwind, !dbg !DILocation(scope: !24)
30 call void @llvm.dbg.value(metadata i64* %data_addr.i17, i64 0, metadata !34, metadata !DIExpression()) nounwind, !dbg !DILocation(scope: !24)
3131 %a13 = load volatile i64, i64* %data_addr.i17, align 8 ; [#uses=1]
3232 %a14 = call i64 @llvm.bswap.i64(i64 %a13) nounwind ; [#uses=2]
3333 %a15 = add i64 %a10, %a14, !dbg !7 ; [#uses=1]
109109
110110 ;
111111 store i32 0, i32* %i.i, align 4, !dbg !39, !tbaa !41
112 tail call void @llvm.dbg.value(metadata %struct.C* %8, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)), !dbg !46
112 tail call void @llvm.dbg.value(metadata %struct.C* %8, i64 0, metadata !27, metadata !DIExpression()), !dbg !46
113113 call void @_ZN1C5m_fn3Ev(%struct.C* %8), !dbg !47
114114 unreachable, !dbg !47
115115 }
3434 %call = tail call i32 @_Z4funcv(), !dbg !19
3535 tail call void @llvm.dbg.value(metadata i32 %call, i64 0, metadata !10, metadata !16), !dbg !17
3636 store volatile i32 %call, i32* %c, align 4, !dbg !19
37 tail call void @llvm.dbg.value(metadata i32* %c, i64 0, metadata !10, metadata !21), !dbg !17
37 tail call void @llvm.dbg.value(metadata i32* %c, i64 0, metadata !10, metadata !16), !dbg !17
3838 %c.0.c.0. = load volatile i32, i32* %c, align 4, !dbg !20
3939 ret i32 %c.0.c.0., !dbg !20
4040 }
7373 !18 = !DILocation(line: 5, column: 3, scope: !4)
7474 !19 = !DILocation(line: 6, column: 7, scope: !4)
7575 !20 = !DILocation(line: 7, column: 3, scope: !4)
76 !21 = !DIExpression(DW_OP_deref)
7776
4343 !6 = !DISubroutineType(types: !7)
4444 !7 = !{null, !8}
4545 !8 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !9)
46 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null)
46 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
4747 !10 = !{i32 2, !"Dwarf Version", i32 4}
4848 !11 = !{i32 1, !"Debug Info Version", i32 3}
4949 !12 = !{!"clang version 3.5.0 "}
126126 !1 = !DIFile(filename: "tmp.cpp", directory: ".")
127127 !2 = !{}
128128 !3 = !{!4, !18, !19, !22, !23, !24}
129 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, file: !1, elements: !5, vtableHolder: !"_ZTS1C", identifier: "_ZTS1C")
129 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, size: 64, align: 64, file: !1, elements: !5, vtableHolder: !"_ZTS1C", identifier: "_ZTS1C")
130130 !5 = !{!6, !13}
131 !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C", flags: DIFlagArtificial, file: !1, scope: !7, baseType: !8)
131 !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C", size: 64, flags: DIFlagArtificial, file: !1, scope: !7, baseType: !8)
132132 !7 = !DIFile(filename: "tmp.cpp", directory: ".")
133133 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !9)
134134 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !10)
138138 !13 = !DISubprogram(name: "foo", linkageName: "_ZN1C3fooEv", line: 2, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !"_ZTS1C", type: !14, containingType: !"_ZTS1C")
139139 !14 = !DISubroutineType(types: !15)
140140 !15 = !{null, !16}
141 !16 = !DIDerivedType(tag: DW_TAG_pointer_type, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C")
141 !16 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C")
142142 !18 = !DICompositeType(tag: DW_TAG_structure_type, name: "bar", line: 7, size: 8, align: 8, file: !1, elements: !2, identifier: "_ZTS3bar")
143143 !19 = !DICompositeType(tag: DW_TAG_structure_type, name: "D", line: 9, size: 8, align: 8, file: !1, elements: !20, identifier: "_ZTS1D")
144144 !20 = !{!21}
145145 !21 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 11, flags: DIFlagStaticMember, file: !1, scope: !"_ZTS1D", baseType: !12)
146146 !22 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", line: 12, size: 8, align: 8, file: !1, scope: !"_ZTS1D", elements: !2, identifier: "_ZTSN1D6NestedE")
147147 !23 = !DICompositeType(tag: DW_TAG_structure_type, name: "Nested2", line: 13, flags: DIFlagFwdDecl, file: !1, scope: !"_ZTS1D", identifier: "_ZTSN1D7Nested2E")
148 !24 = !DICompositeType(tag: DW_TAG_structure_type, name: "virt", line: 15, file: !1, scope: !"_ZTS1D", elements: !25, templateParams: !28, identifier: "_ZTSN1D4virtI3barEE")
148 !24 = !DICompositeType(tag: DW_TAG_structure_type, name: "virt", line: 15, size: 64, align: 64, file: !1, scope: !"_ZTS1D", elements: !25, templateParams: !28, identifier: "_ZTSN1D4virtI3barEE")
149149 !25 = !{!26}
150150 !26 = !DIDerivedType(tag: DW_TAG_member, name: "values", line: 16, size: 64, align: 64, file: !1, scope: !"_ZTSN1D4virtI3barEE", baseType: !27)
151151 !27 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS3bar")
175175 !51 = !DILocalVariable(name: "e", line: 24, scope: !32, file: !7, type: !22)
176176 !52 = !DILocation(line: 24, scope: !32)
177177 !53 = !DILocalVariable(name: "p", line: 25, scope: !32, file: !7, type: !54)
178 !54 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTSN1D7Nested2E")
178 !54 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTSN1D7Nested2E")
179179 !55 = !DILocation(line: 25, scope: !32)
180180 !56 = !DILocalVariable(name: "t", line: 26, scope: !32, file: !7, type: !24)
181181 !57 = !DILocation(line: 26, scope: !32)
2323 define i32 @main(i32 %argc, i8** nocapture %argv) nounwind !dbg !12 {
2424 entry:
2525 tail call void @llvm.dbg.value(metadata i32 %argc, i64 0, metadata !21, metadata !DIExpression()), !dbg !26
26 ; Avoid talking about the pointer size in debug info because that's target dependent
27 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !22, metadata !DIExpression(DW_OP_deref, DW_OP_deref)), !dbg !27
26 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !22, metadata !DIExpression()), !dbg !27
2827 %puts = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str1, i32 0, i32 0)), !dbg !28
2928 tail call void @foo() nounwind, !dbg !30
3029 ret i32 0, !dbg !31
4645 !10 = !{!12}
4746 !12 = distinct !DISubprogram(name: "main", line: 11, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 11, file: !32, scope: !6, type: !13, variables: !19)
4847 !13 = !DISubroutineType(types: !14)
49 !14 = !{!15, !15, !18}
48 !14 = !{!15, !15, !16}
5049 !15 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
50 !16 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !17)
51 !17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, baseType: !18)
5152 !18 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
5253 !19 = !{!21, !22}
5354 !21 = !DILocalVariable(name: "argc", line: 11, arg: 1, scope: !12, file: !6, type: !15)
54 !22 = !DILocalVariable(name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !18)
55 !22 = !DILocalVariable(name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !16)
5556 !23 = !DILocation(line: 6, column: 3, scope: !24)
5657 !24 = distinct !DILexicalBlock(line: 5, column: 16, file: !32, scope: !5)
5758 !25 = !DILocation(line: 7, column: 1, scope: !24)
5656 store i32 %c, i32* %1, align 4
5757 call void @llvm.dbg.declare(metadata i32* %1, metadata !21, metadata !DIExpression()), !dbg !22
5858 call void @llvm.dbg.declare(metadata %struct.A* %a, metadata !23, metadata !DIExpression()), !dbg !24
59 call void @llvm.dbg.declare(metadata void (i32, ...)** %fptr, metadata !25, metadata !DIExpression(DW_OP_deref)), !dbg !27
59 call void @llvm.dbg.declare(metadata void (i32, ...)** %fptr, metadata !25, metadata !DIExpression()), !dbg !27
6060 store void (i32, ...)* @_Z1biz, void (i32, ...)** %fptr, align 8, !dbg !27
6161 ret void, !dbg !28
6262 }
9494 !22 = !DILocation(line: 13, scope: !14)
9595 !23 = !DILocalVariable(name: "a", line: 16, scope: !14, file: !15, type: !4)
9696 !24 = !DILocation(line: 16, scope: !14)
97 ; Manually modifed to avoid dependence on pointer size
98 !25 = !DILocalVariable(name: "fptr", line: 18, scope: !14, file: !15, type: !16)
97 !25 = !DILocalVariable(name: "fptr", line: 18, scope: !14, file: !15, type: !26)
9998 !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16)
10099 !27 = !DILocation(line: 18, scope: !14)
101100 !28 = !DILocation(line: 22, scope: !14)
6464 %1 = load i32, i32* %b.addr, align 4, !dbg !35
6565 %add = add nsw i32 %0, %1, !dbg !36
6666 store i32 %add, i32* %c, align 16, !dbg !33
67 call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !DIExpression(DW_OP_deref)), !dbg !38
67 call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !16), !dbg !38
6868 %2 = load i32, i32* %c, align 16, !dbg !39
6969 %3 = alloca i8, i32 %2, !dbg !40
7070 %4 = bitcast i8* %3 to i32*, !dbg !40
2929 call void @llvm.lifetime.start(i64 4, i8* %0) #4, !dbg !14
3030 tail call void @llvm.dbg.value(metadata i32 23, i64 0, metadata !9, metadata !15), !dbg !16
3131 store i32 23, i32* %x, align 4, !dbg !16, !tbaa !17
32 tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
32 tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
3333 call void @g(i32* nonnull %x) #4, !dbg !21
34 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
34 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
3535 %1 = load i32, i32* %x, align 4, !dbg !22, !tbaa !17
3636 %cmp = icmp eq i32 %1, 42, !dbg !24
3737 br i1 %cmp, label %if.then, label %if.end, !dbg !25
4343
4444 if.end: ; preds = %if.then, %entry
4545 %2 = phi i32 [ 43, %if.then ], [ %1, %entry ], !dbg !27
46 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !dbg !16
46 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !15), !dbg !16
4747 call void @llvm.lifetime.end(i64 4, i8* %0) #4, !dbg !28
4848 ret i32 %2, !dbg !29
4949 }
0 ; RUN: llc < %s | FileCheck %s
1 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32"
2 target triple = "i686-apple-darwin"
1 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
2 target triple = "x86_64-apple-darwin10.0.0"
33 ; PR 9817
44
55
8585 !2 = distinct !DICompileUnit(language: DW_LANG_C89, producer: "clc", isOptimized: false, emissionKind: 1, file: !20, enums: !21, retainedTypes: !21, subprograms: !19, imports: null)
8686 !3 = !DISubroutineType(types: !4)
8787 !4 = !{null, !5}
88 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align:64, scope: !2, baseType: !6)
88 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 32, align: 32, scope: !2, baseType: !6)
8989 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "uint", file: !20, scope: !2, baseType: !7)
9090 !7 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
9191 !8 = !DILocalVariable(name: "ip", line: 1, arg: 1, scope: !0, file: !1, type: !5)
66 ;
77 ; CHECK-LABEL: test:
88 ; CHECK: ##DEBUG_VALUE: foo:i
9
109 %a = type { i32, i32 }
1110
1211 define hidden fastcc %a* @test() #1 !dbg !1 {
8786 "44.i": ; preds = %"42.i"
8887 %2 = load %a*, %a** undef, align 8, !dbg !12
8988 %3 = bitcast %a* %2 to %a*, !dbg !12
90 call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression(DW_OP_deref)), !dbg !12
89 call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression()), !dbg !12
9190 br label %may_unswitch_on.exit, !dbg !12
9291
9392 "45.i": ; preds = %"38.i"
8080 !20 = !DISubprogram(name: "D", line: 4, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !6, scope: !10, type: !21)
8181 !21 = !DISubroutineType(types: !22)
8282 !22 = !{null, !9, !23}
83 !23 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, baseType: !24)
83 !23 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !24)
8484 !24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !10)
8585 !27 = !{!29}
8686 !29 = !DILocalVariable(name: "this", line: 12, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !5, file: !6, type: !30)
5757 for.body: ; preds = %for.body, %entry
5858 %iter.02 = phi i32 [ 0, %entry ], [ %inc, %for.body ]
5959 call void @llvm.lifetime.start(i64 4, i8* %0), !dbg !26
60 call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !16, metadata !DIExpression(DW_OP_deref)) #3, !dbg !26
61 call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)) #3, !dbg !29
60 call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !16, metadata !DIExpression()) #3, !dbg !26
61 call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !27, metadata !DIExpression()) #3, !dbg !29
6262 call void @_Z4sinkPKv(i8* undef) #3, !dbg !29
6363 call void @_Z4sinkPKv(i8* %0) #3, !dbg !30
6464 call void @llvm.lifetime.end(i64 4, i8* %0), !dbg !31
8787
8888 while.body: ; preds = %entry, %while.cond.loopexit
8989 store i32 0, i32* %ref.tmp, align 4, !dbg !41, !tbaa !42
90 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !46
90 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !36), !dbg !46
9191 call void @_Z4funcRKiS0_(i32* dereferenceable(4) %x, i32* dereferenceable(4) %ref.tmp), !dbg !47
9292 %call29 = call i32 @_Z4condv(), !dbg !48
9393 %tobool310 = icmp eq i32 %call29, 0, !dbg !48
9494 br i1 %tobool310, label %while.cond.loopexit, label %while.body4, !dbg !49
9595
9696 while.body4: ; preds = %while.body, %while.body4
97 call void @llvm.dbg.value(metadata i8* %y, i64 0, metadata !23, metadata !DIExpression(DW_OP_deref)), !dbg !50
97 call void @llvm.dbg.value(metadata i8* %y, i64 0, metadata !23, metadata !36), !dbg !50
9898 call void @_Z4funcPv(i8* %y), !dbg !51
99 call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !DIExpression(DW_OP_deref)), !dbg !52
99 call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !36), !dbg !52
100100 call void @_Z4funcPv(i8* %j), !dbg !53
101 call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)), !dbg !54
101 call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !36), !dbg !54
102102 call void @_Z4funcPv(i8* %I), !dbg !55
103103 store i32 0, i32* %ref.tmp5, align 4, !dbg !56, !tbaa !42
104104 store i32 0, i32* %ref.tmp6, align 4, !dbg !57, !tbaa !42
105105 call void @_Z4funcRKiS0_(i32* dereferenceable(4) %ref.tmp5, i32* dereferenceable(4) %ref.tmp6), !dbg !58
106106 call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !28, metadata !36), !dbg !59
107107 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !28, metadata !33), !dbg !59
108 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !dbg !46
108 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !36), !dbg !46
109109 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !60, metadata !33), !dbg !62
110110 call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !60, metadata !35), !dbg !62
111111 call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !60, metadata !36), !dbg !62
2929 !6 = !DIFile(filename: "foo.cpp", directory: "/Users/echristo/tmp")
3030 !7 = !DISubroutineType(types: !8)
3131 !8 = !{null, !9}
32 !9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, size: 64, align: 64, baseType: !10)
32 !9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, baseType: !10)
3333 !10 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
3434 !11 = !DILocalVariable(name: "i", line: 4, arg: 1, scope: !5, file: !6, type: !9)
3535 !12 = !DILocation(line: 4, column: 17, scope: !5)
283283 !19 = !DISubprogram(name: "A", line: 5, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 5, file: !1, scope: !"_ZTS1A", type: !20)
284284 !20 = !DISubroutineType(types: !21)
285285 !21 = !{null, !17, !22}
286 !22 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, baseType: !23)
286 !22 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !23)
287287 !23 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS1A")
288288 !25 = !DISubprogram(name: "operator=", linkageName: "_ZN1AaSERKS_", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !26)
289289 !26 = !DISubroutineType(types: !27)
6666 !1 = !DIFile(filename: "foo.cpp", directory: ".")
6767 !2 = !{}
6868 !3 = !{!4}
69 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, file: !5, elements: !6, identifier: "_ZTS4Base")
69 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base")
7070 !5 = !DIFile(filename: "./a.hpp", directory: ".")
7171 !6 = !{!7, !9}
7272 !7 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8)
7373 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
7474 !9 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10)
75 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS4Base")
75 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4Base")
7676 !11 = !{!12}
7777 !12 = distinct !DISubprogram(name: "f", linkageName: "_Z1fi", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !13, type: !14, variables: !2)
7878 !13 = !DIFile(filename: "foo.cpp", directory: ".")
3939 !1 = !DIFile(filename: "bar.cpp", directory: ".")
4040 !2 = !{}
4141 !3 = !{!4}
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, file: !5, elements: !6, identifier: "_ZTS4Base")
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base")
4343 !5 = !DIFile(filename: "./a.hpp", directory: ".")
4444 !6 = !{!7, !9}
4545 !7 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !5, scope: !"_ZTS4Base", baseType: !8)
4646 !8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
4747 !9 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 3, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS4Base", baseType: !10)
48 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS4Base")
48 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS4Base")
4949 !11 = !{!12, !16}
5050 !12 = distinct !DISubprogram(name: "g", linkageName: "_Z1gi", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 4, file: !1, scope: !13, type: !14, variables: !2)
5151 !13 = !DIFile(filename: "bar.cpp", directory: ".")
9595 !1 = !DIFile(filename: "a.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array")
9696 !2 = !{}
9797 !3 = !{!4, !10}
98 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, file: !1, elements: !5, identifier: "_ZTS1A")
98 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A")
9999 !5 = !{!6}
100100 !6 = !DISubprogram(name: "testA", linkageName: "_ZN1A5testAE2SA", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !7)
101101 !7 = !DISubroutineType(types: !8)
102102 !8 = !{null, !9, !"_ZTS2SA"}
103 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
103 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
104104 !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "SA", line: 1, size: 32, align: 32, file: !1, elements: !11, identifier: "_ZTS2SA")
105105 !11 = !{!12}
106106 !12 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13)
110110 !16 = !DIFile(filename: "a.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array")
111111 !17 = !DISubroutineType(types: !18)
112112 !18 = !{null, !19, !"_ZTS2SA"}
113 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1A")
113 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1A")
114114 !20 = distinct !DISubprogram(name: "testA", linkageName: "_ZN1A5testAE2SA", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1A", type: !7, declaration: !6, variables: !2)
115115 !21 = !{i32 2, !"Dwarf Version", i32 2}
116116 !22 = !{i32 2, !"Debug Info Version", i32 3}
7474 !1 = !DIFile(filename: "b.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array")
7575 !2 = !{}
7676 !3 = !{!4, !10}
77 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 5, file: !1, elements: !5, identifier: "_ZTS1B")
77 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 5, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1B")
7878 !5 = !{!6}
7979 !6 = !DISubprogram(name: "testB", linkageName: "_ZN1B5testBE2SA", line: 7, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1B", type: !7)
8080 !7 = !DISubroutineType(types: !8)
8181 !8 = !{null, !9, !"_ZTS2SA"}
82 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B")
82 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B")
8383 !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "SA", line: 1, size: 32, align: 32, file: !1, elements: !11, identifier: "_ZTS2SA")
8484 !11 = !{!12}
8585 !12 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 2, size: 32, align: 32, file: !1, scope: !"_ZTS2SA", baseType: !13)
8989 !16 = !DIFile(filename: "b.cpp", directory: "/Users/manmanren/test-Nov/type_unique/rdar_di_array")
9090 !17 = !DISubroutineType(types: !18)
9191 !18 = !{null, !19, !"_ZTS2SA"}
92 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !"_ZTS1B")
92 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !"_ZTS1B")
9393 !20 = distinct !DISubprogram(name: "testB", linkageName: "_ZN1B5testBE2SA", line: 7, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 7, file: !1, scope: !"_ZTS1B", type: !7, declaration: !6, variables: !2)
9494 !21 = !{i32 2, !"Dwarf Version", i32 2}
9595 !22 = !{i32 2, !"Debug Info Version", i32 3}
112112 !10 = !{!"clang version 3.8.0 (trunk 254906) (llvm/trunk 254917)"}
113113 !11 = !DILocalVariable(name: "p", scope: !4, file: !1, line: 2, type: !12)
114114 !12 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
115 !13 = !DIExpression(DW_OP_deref)
115 !13 = !DIExpression()
116116 !14 = !DILocation(line: 2, column: 8, scope: !4)
117117 !15 = !DILocation(line: 3, column: 1, scope: !4)
117117
118118 ; Insert a meaningless dbg.value intrinsic; it should have no
119119 ; effect on the working of DSE in any way.
120 call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !10, metadata !DIExpression()), !dbg !DILocation(scope: !4)
120 call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !DIExpression()), !dbg !DILocation(scope: !4)
121121
122122 ; CHECK: store i32 -1, i32* @x, align 4
123123 store i32 -1, i32* @x, align 4
2424 entry:
2525 tail call void @llvm.dbg.value(metadata double* %A, i64 0, metadata !12, metadata !DIExpression()), !dbg !19
2626 tail call void @llvm.dbg.value(metadata i32 %m, i64 0, metadata !13, metadata !DIExpression()), !dbg !19
27 tail call void @llvm.dbg.value(metadata double 0.0, i64 0, metadata !14, metadata !DIExpression()), !dbg !21
28 tail call void @llvm.dbg.value(metadata double 0.2, i64 0, metadata !15, metadata !DIExpression()), !dbg !21
27 tail call void @llvm.dbg.value(metadata i32 00, i64 0, metadata !14, metadata !DIExpression()), !dbg !21
28 tail call void @llvm.dbg.value(metadata i32 02, i64 0, metadata !15, metadata !DIExpression()), !dbg !21
2929 tail call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !16, metadata !DIExpression()), !dbg !23
3030 %cmp8 = icmp sgt i32 %m, 0, !dbg !23
3131 br i1 %cmp8, label %for.body.lr.ph, label %for.end, !dbg !23