Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 1 | ; Test summary parsing (tests all types/fields in various combinations). |
| 2 | ; RUN: llvm-as %s -o - | llvm-dis -o - | FileCheck %s |
| 3 | |
| 4 | ; ModuleID = 'thinlto-summary.thinlto.bc' |
| 5 | |
| 6 | ^0 = module: (path: "thinlto-summary1.o", hash: (1369602428, 2747878711, 259090915, 2507395659, 1141468049)) |
| 7 | ^1 = module: (path: "thinlto-summary2.o", hash: (2998369023, 4283347029, 1195487472, 2757298015, 1852134156)) |
| 8 | |
| 9 | ; Check a function that makes several calls with various profile hotness, and a |
| 10 | ; reference (also tests forward references to function and variables in calls |
| 11 | ; and refs). |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 12 | ^2 = gv: (guid: 1, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 10, calls: ((callee: ^15, hotness: hot), (callee: ^17, hotness: cold), (callee: ^16, hotness: none)), refs: (readonly ^13, ^14)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 13 | |
| 14 | ; Function with a call that has relative block frequency instead of profile |
| 15 | ; hotness. |
| 16 | ^3 = gv: (guid: 2, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 10, calls: ((callee: ^15, relbf: 256))))) |
| 17 | |
| 18 | ; Summaries with different linkage types. |
| 19 | ^4 = gv: (guid: 3, summaries: (function: (module: ^0, flags: (linkage: internal, notEligibleToImport: 0, live: 0, dsoLocal: 1), insts: 1))) |
| 20 | ; Make this one an alias with a forward reference to aliasee. |
| 21 | ^5 = gv: (guid: 4, summaries: (alias: (module: ^0, flags: (linkage: private, notEligibleToImport: 0, live: 0, dsoLocal: 1), aliasee: ^14))) |
| 22 | ^6 = gv: (guid: 5, summaries: (function: (module: ^0, flags: (linkage: available_externally, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 23 | ^7 = gv: (guid: 6, summaries: (function: (module: ^0, flags: (linkage: linkonce, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 24 | ^8 = gv: (guid: 7, summaries: (function: (module: ^0, flags: (linkage: linkonce_odr, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 25 | ^9 = gv: (guid: 8, summaries: (function: (module: ^0, flags: (linkage: weak_odr, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 26 | ^10 = gv: (guid: 9, summaries: (function: (module: ^0, flags: (linkage: weak, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 27 | ^11 = gv: (guid: 10, summaries: (variable: (module: ^0, flags: (linkage: common, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 0)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 28 | ; Test appending globel variable with reference (tests backward reference on |
| 29 | ; refs). |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 30 | ^12 = gv: (guid: 11, summaries: (variable: (module: ^0, flags: (linkage: appending, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 0), refs: (^4)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 31 | |
| 32 | ; Test a referenced global variable. |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 33 | ^13 = gv: (guid: 12, summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 1)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 34 | |
| 35 | ; Test a dsoLocal variable. |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 36 | ^14 = gv: (guid: 13, summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 1), varFlags: (readonly: 0)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 37 | |
| 38 | ; Functions with various flag combinations (notEligibleToImport, Live, |
| 39 | ; combinations of optional function flags). |
| 40 | ^15 = gv: (guid: 14, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 1, live: 1, dsoLocal: 0), insts: 1))) |
| 41 | ^16 = gv: (guid: 15, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1, funcFlags: (readNone: 1, noRecurse: 1)))) |
| 42 | ; This one also tests backwards reference in calls. |
| 43 | ^17 = gv: (guid: 16, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1, funcFlags: (readOnly: 1, returnDoesNotAlias: 1), calls: ((callee: ^15))))) |
| 44 | |
| 45 | ; Alias summary with backwards reference to aliasee. |
| 46 | ^18 = gv: (guid: 17, summaries: (alias: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 1), aliasee: ^14))) |
| 47 | |
| 48 | ; Test all types of TypeIdInfo on function summaries. |
| 49 | ^19 = gv: (guid: 18, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 4, typeIdInfo: (typeTests: (^24, ^26))))) |
| 50 | ^20 = gv: (guid: 19, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 8, typeIdInfo: (typeTestAssumeVCalls: (vFuncId: (^27, offset: 16)))))) |
| 51 | ^21 = gv: (guid: 20, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 5, typeIdInfo: (typeCheckedLoadVCalls: (vFuncId: (^25, offset: 16)))))) |
Teresa Johnson | d64c9dd | 2018-08-14 01:49:33 +0000 | [diff] [blame] | 52 | ^22 = gv: (guid: 21, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 15, typeIdInfo: (typeTestAssumeConstVCalls: ((vFuncId: (^27, offset: 16), args: (42)), (vFuncId: (^27, offset: 24))))))) |
| 53 | ^23 = gv: (guid: 22, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 5, typeIdInfo: (typeCheckedLoadConstVCalls: ((vFuncId: (^28, offset: 16), args: (42))))))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 54 | |
| 55 | ; Test TypeId summaries: |
| 56 | |
Teresa Johnson | 0d4dfd2 | 2018-09-25 20:14:40 +0000 | [diff] [blame] | 57 | ^24 = typeid: (name: "_ZTS1C", summary: (typeTestRes: (kind: single, sizeM1BitWidth: 0))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 58 | ; Test TypeId with other optional fields (alignLog2/sizeM1/bitMask/inlineBits) |
| 59 | ^25 = typeid: (name: "_ZTS1B", summary: (typeTestRes: (kind: inline, sizeM1BitWidth: 0, alignLog2: 1, sizeM1: 2, bitMask: 3, inlineBits: 4))) |
Teresa Johnson | 0d4dfd2 | 2018-09-25 20:14:40 +0000 | [diff] [blame] | 60 | ; Test the AllOnes resolution, and all kinds of WholeProgramDevirtResolution |
| 61 | ; types, including all optional resolution by argument kinds. |
| 62 | ^26 = typeid: (name: "_ZTS1A", summary: (typeTestRes: (kind: allOnes, sizeM1BitWidth: 7), wpdResolutions: ((offset: 0, wpdRes: (kind: branchFunnel)), (offset: 8, wpdRes: (kind: singleImpl, singleImplName: "_ZN1A1nEi")), (offset: 16, wpdRes: (kind: indir, resByArg: (args: (1, 2), byArg: (kind: indir, byte: 2, bit: 3), args: (3), byArg: (kind: uniformRetVal, info: 1), args: (4), byArg: (kind: uniqueRetVal, info: 1), args: (5), byArg: (kind: virtualConstProp))))))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 63 | ; Test the other kinds of type test resoultions |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 64 | ^27 = typeid: (name: "_ZTS1D", summary: (typeTestRes: (kind: byteArray, sizeM1BitWidth: 0))) |
| 65 | ^28 = typeid: (name: "_ZTS1E", summary: (typeTestRes: (kind: unsat, sizeM1BitWidth: 0))) |
| 66 | |
| 67 | ; Make sure we get back from llvm-dis essentially what we put in via llvm-as. |
| 68 | ; CHECK: ^0 = module: (path: "thinlto-summary1.o", hash: (1369602428, 2747878711, 259090915, 2507395659, 1141468049)) |
| 69 | ; CHECK: ^1 = module: (path: "thinlto-summary2.o", hash: (2998369023, 4283347029, 1195487472, 2757298015, 1852134156)) |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 70 | ; CHECK: ^2 = gv: (guid: 1, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 10, calls: ((callee: ^15, hotness: hot), (callee: ^17, hotness: cold), (callee: ^16, hotness: none)), refs: (^14, readonly ^13)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 71 | ; CHECK: ^3 = gv: (guid: 2, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 10, calls: ((callee: ^15))))) |
| 72 | ; CHECK: ^4 = gv: (guid: 3, summaries: (function: (module: ^0, flags: (linkage: internal, notEligibleToImport: 0, live: 0, dsoLocal: 1), insts: 1))) |
| 73 | ; CHECK: ^5 = gv: (guid: 4, summaries: (alias: (module: ^0, flags: (linkage: private, notEligibleToImport: 0, live: 0, dsoLocal: 1), aliasee: ^14))) |
| 74 | ; CHECK: ^6 = gv: (guid: 5, summaries: (function: (module: ^0, flags: (linkage: available_externally, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 75 | ; CHECK: ^7 = gv: (guid: 6, summaries: (function: (module: ^0, flags: (linkage: linkonce, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 76 | ; CHECK: ^8 = gv: (guid: 7, summaries: (function: (module: ^0, flags: (linkage: linkonce_odr, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 77 | ; CHECK: ^9 = gv: (guid: 8, summaries: (function: (module: ^0, flags: (linkage: weak_odr, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
| 78 | ; CHECK: ^10 = gv: (guid: 9, summaries: (function: (module: ^0, flags: (linkage: weak, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1))) |
Eugene Leviant | ae9f773 | 2018-11-23 10:54:51 +0000 | [diff] [blame] | 79 | ; CHECK: ^11 = gv: (guid: 10, summaries: (variable: (module: ^0, flags: (linkage: common, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 0)))) |
| 80 | ; CHECK: ^12 = gv: (guid: 11, summaries: (variable: (module: ^0, flags: (linkage: appending, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 0), refs: (^4)))) |
| 81 | ; CHECK: ^13 = gv: (guid: 12, summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), varFlags: (readonly: 1)))) |
| 82 | ; CHECK: ^14 = gv: (guid: 13, summaries: (variable: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 1), varFlags: (readonly: 0)))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 83 | ; CHECK: ^15 = gv: (guid: 14, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 1, live: 1, dsoLocal: 0), insts: 1))) |
Teresa Johnson | 645cd31 | 2018-11-06 19:41:35 +0000 | [diff] [blame] | 84 | ; CHECK: ^16 = gv: (guid: 15, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1, funcFlags: (readNone: 1, readOnly: 0, noRecurse: 1, returnDoesNotAlias: 0, noInline: 0)))) |
| 85 | ; CHECK: ^17 = gv: (guid: 16, summaries: (function: (module: ^1, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 1, funcFlags: (readNone: 0, readOnly: 1, noRecurse: 0, returnDoesNotAlias: 1, noInline: 0), calls: ((callee: ^15))))) |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 86 | ; CHECK: ^18 = gv: (guid: 17, summaries: (alias: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 1), aliasee: ^14))) |
| 87 | ; CHECK: ^19 = gv: (guid: 18, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 4, typeIdInfo: (typeTests: (^24, ^26))))) |
| 88 | ; CHECK: ^20 = gv: (guid: 19, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 8, typeIdInfo: (typeTestAssumeVCalls: (vFuncId: (^27, offset: 16)))))) |
| 89 | ; CHECK: ^21 = gv: (guid: 20, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 5, typeIdInfo: (typeCheckedLoadVCalls: (vFuncId: (^25, offset: 16)))))) |
Teresa Johnson | d64c9dd | 2018-08-14 01:49:33 +0000 | [diff] [blame] | 90 | ; CHECK: ^22 = gv: (guid: 21, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 15, typeIdInfo: (typeTestAssumeConstVCalls: ((vFuncId: (^27, offset: 16), args: (42)), (vFuncId: (^27, offset: 24))))))) |
| 91 | ; CHECK: ^23 = gv: (guid: 22, summaries: (function: (module: ^0, flags: (linkage: external, notEligibleToImport: 0, live: 0, dsoLocal: 0), insts: 5, typeIdInfo: (typeCheckedLoadConstVCalls: ((vFuncId: (^28, offset: 16), args: (42))))))) |
Teresa Johnson | 0d4dfd2 | 2018-09-25 20:14:40 +0000 | [diff] [blame] | 92 | ; CHECK: ^24 = typeid: (name: "_ZTS1C", summary: (typeTestRes: (kind: single, sizeM1BitWidth: 0))) ; guid = 1884921850105019584 |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 93 | ; CHECK: ^25 = typeid: (name: "_ZTS1B", summary: (typeTestRes: (kind: inline, sizeM1BitWidth: 0, alignLog2: 1, sizeM1: 2, bitMask: 3, inlineBits: 4))) ; guid = 6203814149063363976 |
Teresa Johnson | 0d4dfd2 | 2018-09-25 20:14:40 +0000 | [diff] [blame] | 94 | ; CHECK: ^26 = typeid: (name: "_ZTS1A", summary: (typeTestRes: (kind: allOnes, sizeM1BitWidth: 7), wpdResolutions: ((offset: 0, wpdRes: (kind: branchFunnel)), (offset: 8, wpdRes: (kind: singleImpl, singleImplName: "_ZN1A1nEi")), (offset: 16, wpdRes: (kind: indir, resByArg: (args: (1, 2), byArg: (kind: indir, byte: 2, bit: 3), args: (3), byArg: (kind: uniformRetVal, info: 1), args: (4), byArg: (kind: uniqueRetVal, info: 1), args: (5), byArg: (kind: virtualConstProp))))))) ; guid = 7004155349499253778 |
Teresa Johnson | c6dda90 | 2018-06-26 13:56:49 +0000 | [diff] [blame] | 95 | ; CHECK: ^27 = typeid: (name: "_ZTS1D", summary: (typeTestRes: (kind: byteArray, sizeM1BitWidth: 0))) ; guid = 9614786172484273522 |
| 96 | ; CHECK: ^28 = typeid: (name: "_ZTS1E", summary: (typeTestRes: (kind: unsat, sizeM1BitWidth: 0))) ; guid = 17437243864166745132 |