llvm.org GIT mirror llvm / 621b821
Reapply r257105 "[Verifier] Check that debug values have proper size" I originally reapplied this in 257550, but had to revert again due to bot breakage. The only change in this version is to allow either the TypeSize or the TypeAllocSize of the variable to be the one represented in debug info (hopefully in the future we can figure out how to encode the difference). Additionally, several bot failures following r257550, were due to optimizer bugs now fixed in r257787 and r257795. r257550 commit message was: ``` The follow extra changes were made to test cases: Manually making the variable be the actual type instead of a pointer to avoid pointer-size differences in generic code: LLVM :: DebugInfo/Generic/2010-03-24-MemberFn.ll LLVM :: DebugInfo/Generic/2010-04-06-NestedFnDbgInfo.ll LLVM :: DebugInfo/Generic/2010-05-03-DisableFramePtr.ll LLVM :: DebugInfo/Generic/varargs.ll Delete sizing information from debug info for the same reason (but the presence of the pointer was important to the test case): LLVM :: DebugInfo/Generic/restrict.ll LLVM :: DebugInfo/Generic/tu-composite.ll LLVM :: Linker/type-unique-type-array-a.ll LLVM :: Linker/type-unique-simple2.ll Fixing an incorrect DW_OP_deref LLVM :: DebugInfo/Generic/2010-05-03-OriginDIE.ll Fixing a missing DW_OP_deref LLVM :: DebugInfo/Generic/incorrect-variable-debugloc.ll Additionally, clang should no longer complain during bootstrap should no longer happen after r257534. The original commit message was: `` Summary: Teach the Verifier to make sure that the storage size given to llvm.dbg.declare or the value size given to llvm.dbg.value agree with what is declared in DebugInfo. This is implicitly assumed in a number of passes (e.g. in SROA). Additionally this catches a number of common mistakes, such as passing a pointer when a value was intended or vice versa. One complication comes from stack coloring which modifies the original IR when it merges allocas in order to make sure that if AA falls back to the IR it gets the correct result. However, given this new invariant, indiscriminately replacing one alloca by a different (differently sized one) is no longer valid. Fix this by just undefing out any use of the alloca in a dbg.declare in this case. Additionally, I had to fix a number of test cases. Of particular note: - I regenerated dbg-changes-codegen-branch-folding.ll from the given source as it was affected by the bug fixed in r256077 - two-cus-from-same-file.ll was changed to avoid having a variable-typed debug variable as that would depend on the target, even though this test is supposed to be generic - I had to manually declared size/align for reference type. See also the discussion for D14275/r253186. - fpstack-debuginstr-kill.ll required changing `double` to `long double` - most others were just a question of adding OP_deref `` ``` git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@257850 91177308-0d34-0410-b5e6-96231b3b80d8 Keno Fischer 3 years ago
38 changed file(s) with 293 addition(s) and 210 deletion(s). Raw diff Collapse all Expand all
2020 //
2121 //===----------------------------------------------------------------------===//
2222
23 #include "llvm/CodeGen/Passes.h"
2423 #include "llvm/ADT/BitVector.h"
2524 #include "llvm/ADT/DepthFirstIterator.h"
2625 #include "llvm/ADT/PostOrderIterator.h"
3938 #include "llvm/CodeGen/MachineMemOperand.h"
4039 #include "llvm/CodeGen/MachineModuleInfo.h"
4140 #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"
5051 #include "llvm/IR/Module.h"
5152 #include "llvm/Support/CommandLine.h"
5253 #include "llvm/Support/Debug.h"
494495 // upcoming replacement.
495496 SP->adjustForColoring(From, To);
496497
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
497509 // Note that this will not replace uses in MMOs (which we'll update below),
498510 // or anywhere else (which is why we won't delete the original
499511 // instruction).
500 const_cast(From)->replaceAllUsesWith(Inst);
512 FromAI->replaceAllUsesWith(Inst);
501513 }
502514
503515 // Remap all instructions to the new stack slots.
445445 // Module-level debug info verification...
446446 void verifyTypeRefs();
447447 template
448 void verifyBitPieceExpression(const DbgInfoIntrinsic &I,
449 const MapTy &TypeRefs);
448 void verifyDIExpression(const DbgInfoIntrinsic &I, const MapTy &TypeRefs);
450449 void visitUnresolvedTypeRef(const MDString *S, const MDNode *N);
451450 };
452451 } // End anonymous namespace
41284127 }
41294128
41304129 template
4131 void Verifier::verifyBitPieceExpression(const DbgInfoIntrinsic &I,
4132 const MapTy &TypeRefs) {
4130 void Verifier::verifyDIExpression(const DbgInfoIntrinsic &I,
4131 const MapTy &TypeRefs) {
41334132 DILocalVariable *V;
41344133 DIExpression *E;
4134 const Value *Arg;
4135 // For now we check both the TypeSize and the TypeAllocSize because the
4136 // difference is not clear in the IR Metadata
4137 uint64_t ArgumentTypeSizeInBits = 0, ArgumentTypeAllocSizeInBits = 0;
41354138 if (auto *DVI = dyn_cast(&I)) {
4139 Arg = DVI->getValue();
4140 if (Arg) {
4141 ArgumentTypeAllocSizeInBits =
4142 M->getDataLayout().getTypeAllocSizeInBits(Arg->getType());
4143 ArgumentTypeSizeInBits =
4144 M->getDataLayout().getTypeSizeInBits(Arg->getType());
4145 }
41364146 V = dyn_cast_or_null(DVI->getRawVariable());
41374147 E = dyn_cast_or_null(DVI->getRawExpression());
41384148 } else {
41394149 auto *DDI = cast(&I);
4150 // For declare intrinsics, get the total size of the alloca, to allow
4151 // case where the variable may span more than one element.
4152 Arg = DDI->getAddress();
4153 if (Arg)
4154 Arg = Arg->stripPointerCasts();
4155 const AllocaInst *AI = dyn_cast_or_null(Arg);
4156 if (AI) {
4157 // We can only say something about constant size allocations
4158 if (const ConstantInt *CI = dyn_cast(AI->getArraySize())) {
4159 ArgumentTypeAllocSizeInBits =
4160 CI->getLimitedValue() *
4161 M->getDataLayout().getTypeAllocSizeInBits(AI->getAllocatedType());
4162 ArgumentTypeSizeInBits =
4163 CI->getLimitedValue() *
4164 M->getDataLayout().getTypeSizeInBits(AI->getAllocatedType());
4165 }
4166 }
41404167 V = dyn_cast_or_null(DDI->getRawVariable());
41414168 E = dyn_cast_or_null(DDI->getRawExpression());
41424169 }
41434170
41444171 // We don't know whether this intrinsic verified correctly.
41454172 if (!V || !E || !E->isValid())
4146 return;
4147
4148 // Nothing to do if this isn't a bit piece expression.
4149 if (!E->isBitPiece())
41504173 return;
41514174
41524175 // The frontend helps out GDB by emitting the members of local anonymous
41644187 if (!VarSize)
41654188 return;
41664189
4167 unsigned PieceSize = E->getBitPieceSize();
4168 unsigned PieceOffset = E->getBitPieceOffset();
4169 Assert(PieceSize + PieceOffset <= VarSize,
4170 "piece is larger than or outside of variable", &I, V, E);
4171 Assert(PieceSize != VarSize, "piece covers entire variable", &I, V, E);
4190 if (E->isBitPiece()) {
4191 unsigned PieceSize = E->getBitPieceSize();
4192 unsigned PieceOffset = E->getBitPieceOffset();
4193 Assert(PieceSize + PieceOffset <= VarSize,
4194 "piece is larger than or outside of variable", &I, V, E);
4195 Assert(PieceSize != VarSize, "piece covers entire variable", &I, V, E);
4196 return;
4197 }
4198
4199 if (!ArgumentTypeSizeInBits)
4200 return; // We were unable to determine the size of the argument
4201
4202 if (E->getNumElements() == 0) {
4203 // In the case where the expression is empty, verify the size of the
4204 // argument. Doing this in the general case would require looking through
4205 // any dereferences that may be in the expression.
4206 Assert(ArgumentTypeSizeInBits == VarSize ||
4207 ArgumentTypeAllocSizeInBits == VarSize,
4208 "size of passed value (" + Twine(ArgumentTypeSizeInBits) +
4209 ", with padding " + Twine(ArgumentTypeAllocSizeInBits) +
4210 ") does not match size of declared variable (" + Twine(VarSize) +
4211 ")",
4212 &I, Arg, V, V->getType(), E);
4213 } else if (E->getElement(0) == dwarf::DW_OP_deref) {
4214 // Pointers shouldn't have any alignment padding, so no need to check
4215 // the alloc size
4216 Assert(ArgumentTypeSizeInBits == M->getDataLayout().getPointerSizeInBits(),
4217 "the operation of the expression is a deref, but the passed value "
4218 "is not pointer sized",
4219 &I, Arg, V, V->getType(), E);
4220 }
41724221 }
41734222
41744223 void Verifier::visitUnresolvedTypeRef(const MDString *S, const MDNode *N) {
42014250 for (const BasicBlock &BB : F)
42024251 for (const Instruction &I : BB)
42034252 if (auto *DII = dyn_cast(&I))
4204 verifyBitPieceExpression(*DII, TypeRefs);
4253 verifyDIExpression(*DII, TypeRefs);
42054254
42064255 // Return early if all typerefs were resolved.
42074256 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"
25
36 %struct.SVal = type { i8*, i32 }
47
7780 !llvm.module.flags = !{!49}
7881
7982 !0 = !DISubprogram(name: "SVal", line: 11, isLocal: false, isDefinition: false, virtualIndex: 6, isOptimized: false, file: !48, scope: !1, type: !14)
80 !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", line: 1, size: 128, align: 64, file: !48, elements: !4)
83 !1 = !DICompositeType(tag: DW_TAG_structure_type, name: "SVal", line: 1, size: 64, align: 64, file: !48, elements: !4)
8184 !2 = !DIFile(filename: "small.cc", directory: "/Users/manav/R8248330")
8285 !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)
8386 !4 = !{!5, !7, !0, !9}
102105 !23 = !DILocalVariable(name: "i", line: 16, arg: 1, scope: !17, file: !2, type: !13)
103106 !24 = !DILocation(line: 16, scope: !17)
104107 !25 = !DILocalVariable(name: "location", line: 16, arg: 2, scope: !17, file: !2, type: !26)
105 !26 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", size: 64, align: 64, file: !48, scope: !2, baseType: !1)
108 !26 = !DIDerivedType(tag: DW_TAG_reference_type, name: "SVal", size: 32, align: 32, file: !48, scope: !2, baseType: !1)
106109 !27 = !DILocation(line: 17, scope: !28)
107110 !28 = distinct !DILexicalBlock(line: 16, column: 0, file: !2, scope: !17)
108111 !29 = !DILocation(line: 18, scope: !28)
109112 !30 = !DILocation(line: 20, scope: !28)
110113 !31 = !DILocalVariable(name: "this", line: 11, arg: 1, scope: !16, file: !2, type: !32)
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)
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)
113116 !34 = !DILocation(line: 11, scope: !16)
114117 !35 = !DILocation(line: 11, scope: !36)
115118 !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 [256 x i8]* %y.i to i8*
8 %0 = bitcast i8* %x.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: !6)
37 !4 = !DILocalVariable(name: "x", scope: !5, file: !1, line: 16, type: !9)
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)
4245 ...
4346 ---
4447 name: foo
4952 # CHECK-LABEL: foo
5053 # CHECK: stack:
5154 # CHECK: - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
52 # CHECK-NEXT: di-expression: '!7', di-location: '!8' }
55 # CHECK-NEXT: di-expression: '!10', di-location: '!11' }
5356 stack:
5457 - { id: 0, name: y.i, offset: 0, size: 256, alignment: 16, di-variable: '!4',
5558 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: 512, align: 64, file: !6)
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "btCompoundLeafCallback", line: 90, size: 64, 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: !9)
38 !8 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !0, baseType: !5)
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: !9)
40 !10 = !DILocalVariable(name: "a", line: 3, scope: !11, file: !2, type: !5)
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 @.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
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
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 !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
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
5757 %tobool = icmp eq i32 %param2, 0, !dbg !50
58 br i1 %tobool, label %if.end, label %if.then, !dbg !50
58 br i1 %tobool, label %if.end, label %if.then, !dbg !52
5959
6060 if.then: ; preds = %entry
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
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
6464
6565 if.end: ; preds = %entry, %if.then
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
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
7982
8083 if.then2: ; preds = %if.end
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
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
8587
8688 if.else: ; preds = %if.end
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
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
9091 br label %if.end3
9192
9293 if.end3: ; preds = %if.else, %if.then2
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
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
98101 }
99102
100 declare i8* @_Z5i2stri(i32) #1
101
102 declare void @_Z3fooPcjPKc(i8*, i32, i8*) #1
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
103112
104113 ; Function Attrs: nounwind readnone
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 }
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 }
110121
111122 !llvm.dbg.cu = !{!0}
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")
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")
117128 !2 = !{}
118129 !3 = !{!4}
119 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "AAA3", line: 4, size: 32, align: 8, file: !1, elements: !5, identifier: "_ZTS4AAA3")
130 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "AAA3", file: !1, line: 4, size: 32, align: 8, elements: !5, identifier: "_ZTS4AAA3")
120131 !5 = !{!6, !11, !17, !18}
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)
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)
124135 !9 = !{!10}
125136 !10 = !DISubrange(count: 4)
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)
137 !11 = !DISubprogram(name: "AAA3", scope: !"_ZTS4AAA3", file: !1, line: 5, type: !12, isLocal: false, isDefinition: false, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true)
127138 !12 = !DISubroutineType(types: !13)
128139 !13 = !{null, !14, !15}
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)
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)
131142 !16 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)
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)
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)
134145 !19 = !DISubroutineType(types: !20)
135146 !20 = !{!15, !21}
136 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !22)
147 !21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !22, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
137148 !22 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !"_ZTS4AAA3")
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)
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)
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: "double", size: 64, align: 64, encoding: DW_ATE_float)
62 !17 = !DIBasicType(tag: DW_TAG_base_type, name: "long double", size: 128, align: 128, 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 !29), !dbg !DILocation(scope: !13)
51 tail call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !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 !29), !dbg !DILocation(scope: !13)
54 call void @llvm.dbg.value(metadata %class.C* %c, i64 0, metadata !18, metadata !DIExpression(DW_OP_deref)), !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()
241 !79 = !DIExpression(DW_OP_deref)
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()), !dbg !21
27 call void @llvm.dbg.declare(metadata %struct.S** %this_addr, metadata !18, metadata !DIExpression(DW_OP_deref)), !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 !18 = !DILocalVariable(name: "this", line: 3, arg: 1, scope: !12, file: !10, type: !19)
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)
6061 !19 = !DIDerivedType(tag: DW_TAG_const_type, size: 64, align: 64, flags: DIFlagArtificial, file: !25, scope: !4, baseType: !20)
6162 !20 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !25, scope: !4, baseType: !9)
6263 !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()), !dbg !18
44 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !17, metadata !DIExpression(DW_OP_deref)), !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()), !dbg !34
61 call void @llvm.dbg.declare(metadata %class.A** %this.addr, metadata !33, metadata !DIExpression(DW_OP_deref)), !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 !17 = !DILocalVariable(name: "this", line: 4, arg: 1, scope: !10, file: !3, type: !13)
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)
9091 !18 = !DILocation(line: 4, column: 7, scope: !10)
9192 !19 = !DILocalVariable(name: "a", line: 9, scope: !20, file: !3, type: !21)
9293 !20 = distinct !DILexicalBlock(line: 4, column: 12, file: !38, scope: !10)
102103 !30 = !DILocation(line: 10, column: 5, scope: !20)
103104 !31 = !DILocation(line: 11, column: 5, scope: !20)
104105 !32 = !DILocation(line: 12, column: 3, scope: !10)
105 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !26)
106 ; Manually modified like !17 above
107 !33 = !DILocalVariable(name: "this", line: 7, arg: 1, scope: !23, file: !3, type: !21)
106108 !34 = !DILocation(line: 7, column: 11, scope: !23)
107109 !35 = !DILocation(line: 7, column: 19, scope: !36)
108110 !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()), !dbg !13
8 call void @llvm.dbg.declare(metadata void (%struct.AppleEvent*)** %userUPP_addr, metadata !0, metadata !DIExpression(DW_OP_deref)), !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 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "DMNotificationUPP", line: 6, file: !16, scope: !2, baseType: !7)
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)
2728 !7 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, file: !16, scope: !2, baseType: !8)
2829 !8 = !DISubroutineType(types: !9)
2930 !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()) 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)
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()), !dbg !46
112 tail call void @llvm.dbg.value(metadata %struct.C* %8, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)), !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 !16), !dbg !17
37 tail call void @llvm.dbg.value(metadata i32* %c, i64 0, metadata !10, metadata !21), !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)
7677
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, size: 64, align: 64, baseType: null)
46 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 64, align: 64, file: !1, elements: !5, vtableHolder: !"_ZTS1C", identifier: "_ZTS1C")
129 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "C", line: 1, file: !1, elements: !5, vtableHolder: !"_ZTS1C", identifier: "_ZTS1C")
130130 !5 = !{!6, !13}
131 !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C", size: 64, flags: DIFlagArtificial, file: !1, scope: !7, baseType: !8)
131 !6 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$C", 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, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1C")
141 !16 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 64, align: 64, file: !1, scope: !"_ZTS1D", elements: !25, templateParams: !28, identifier: "_ZTSN1D4virtI3barEE")
148 !24 = !DICompositeType(tag: DW_TAG_structure_type, name: "virt", line: 15, 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, size: 64, align: 64, baseType: !"_ZTSN1D7Nested2E")
178 !54 = !DIDerivedType(tag: DW_TAG_pointer_type, 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 tail call void @llvm.dbg.value(metadata i8** %argv, i64 0, metadata !22, metadata !DIExpression()), !dbg !27
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
2728 %puts = tail call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str1, i32 0, i32 0)), !dbg !28
2829 tail call void @foo() nounwind, !dbg !30
2930 ret i32 0, !dbg !31
4546 !10 = !{!12}
4647 !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)
4748 !13 = !DISubroutineType(types: !14)
48 !14 = !{!15, !15, !16}
49 !14 = !{!15, !15, !18}
4950 !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)
5251 !18 = !DIBasicType(tag: DW_TAG_base_type, name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char)
5352 !19 = !{!21, !22}
5453 !21 = !DILocalVariable(name: "argc", line: 11, arg: 1, scope: !12, file: !6, type: !15)
55 !22 = !DILocalVariable(name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !16)
54 !22 = !DILocalVariable(name: "argv", line: 11, arg: 2, scope: !12, file: !6, type: !18)
5655 !23 = !DILocation(line: 6, column: 3, scope: !24)
5756 !24 = distinct !DILexicalBlock(line: 5, column: 16, file: !32, scope: !5)
5857 !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()), !dbg !27
59 call void @llvm.dbg.declare(metadata void (i32, ...)** %fptr, metadata !25, metadata !DIExpression(DW_OP_deref)), !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 !25 = !DILocalVariable(name: "fptr", line: 18, scope: !14, file: !15, type: !26)
97 ; Manually modifed to avoid dependence on pointer size
98 !25 = !DILocalVariable(name: "fptr", line: 18, scope: !14, file: !15, type: !16)
9899 !26 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !16)
99100 !27 = !DILocation(line: 18, scope: !14)
100101 !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 !16), !dbg !38
67 call void @llvm.dbg.declare(metadata i32** %w, metadata !37, metadata !DIExpression(DW_OP_deref)), !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 !15), !dbg !16
32 tail call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !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 !15), !dbg !16
34 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !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 !15), !dbg !16
46 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !9, metadata !DIExpression(DW_OP_deref)), !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: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"
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"
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: 32, align: 32, scope: !2, baseType: !6)
88 !5 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align:64, 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
910 %a = type { i32, i32 }
1011
1112 define hidden fastcc %a* @test() #1 !dbg !1 {
8687 "44.i": ; preds = %"42.i"
8788 %2 = load %a*, %a** undef, align 8, !dbg !12
8889 %3 = bitcast %a* %2 to %a*, !dbg !12
89 call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression()), !dbg !12
90 call void @llvm.dbg.value(metadata %a* %3, i64 0, metadata !6, metadata !DIExpression(DW_OP_deref)), !dbg !12
9091 br label %may_unswitch_on.exit, !dbg !12
9192
9293 "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, baseType: !24)
83 !23 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, 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()) #3, !dbg !26
61 call void @llvm.dbg.value(metadata %struct.string* %str2.i, i64 0, metadata !27, metadata !DIExpression()) #3, !dbg !29
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
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 !36), !dbg !46
90 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !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 !36), !dbg !50
97 call void @llvm.dbg.value(metadata i8* %y, i64 0, metadata !23, metadata !DIExpression(DW_OP_deref)), !dbg !50
9898 call void @_Z4funcPv(i8* %y), !dbg !51
99 call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !36), !dbg !52
99 call void @llvm.dbg.value(metadata i8* %j, i64 0, metadata !26, metadata !DIExpression(DW_OP_deref)), !dbg !52
100100 call void @_Z4funcPv(i8* %j), !dbg !53
101 call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !36), !dbg !54
101 call void @llvm.dbg.value(metadata i8* %I, i64 0, metadata !27, metadata !DIExpression(DW_OP_deref)), !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 !36), !dbg !46
108 call void @llvm.dbg.value(metadata i32* %x, i64 0, metadata !21, metadata !DIExpression(DW_OP_deref)), !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, baseType: !10)
32 !9 = !DIDerivedType(tag: DW_TAG_rvalue_reference_type, size: 64, align: 64, 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, baseType: !23)
286 !22 = !DIDerivedType(tag: DW_TAG_reference_type, size: 64, align: 64, 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, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base")
69 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, 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, size: 64, align: 64, baseType: !"_ZTS4Base")
75 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 128, align: 64, file: !5, elements: !6, identifier: "_ZTS4Base")
42 !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Base", line: 1, 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, size: 64, align: 64, baseType: !"_ZTS4Base")
48 !10 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1A")
98 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "A", line: 5, 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, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1A")
103 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 64, align: 64, baseType: !"_ZTS1A")
113 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 8, align: 8, file: !1, elements: !5, identifier: "_ZTS1B")
77 !4 = !DICompositeType(tag: DW_TAG_class_type, name: "B", line: 5, 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, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B")
82 !9 = !DIDerivedType(tag: DW_TAG_pointer_type, 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, size: 64, align: 64, baseType: !"_ZTS1B")
92 !19 = !DIDerivedType(tag: DW_TAG_pointer_type, 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()
115 !13 = !DIExpression(DW_OP_deref)
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 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
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
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