Skip to content

Commit 5bbce06

Browse files
authored
[PseudoProbe] Mix block and call probe ID in lexical order (#75092)
Before all the call probe ids are after block ids, in this change, it mixed the call probe and block probe by reordering them in lexical(line-number) order. For example: ``` main(): BB1 if(...) BB2 foo(..); else BB3 bar(...); BB4 ``` Before the profile is ``` main 1: .. 2: .. 3: ... 4: ... 5: foo ... 6: bar ... ``` Now the new order is ``` main 1: .. 2: .. 3: foo ... 4: ... 5: bar ... 6: ... ``` This can potentially make it more tolerant of profile mismatch, either from stale profile or frontend change. e.g. before if we add one block, even the block is the last one, all the call probes are shifted and mismatched. Moreover, this makes better use of call-anchor based stale profile matching. Blocks are matched based on the closest anchor, there would be more anchors used for the matching, reduce the mismatch scope.
1 parent 42c7bc0 commit 5bbce06

File tree

13 files changed

+71
-79
lines changed

13 files changed

+71
-79
lines changed

clang/test/CodeGen/pseudo-probe-emit.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ void foo(int x) {
1010
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 1, i32 0, i64 -1)
1111
if (x == 0)
1212
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 2, i32 0, i64 -1)
13-
bar();
13+
bar(); // probe id : 3
1414
else
15-
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 3, i32 0, i64 -1)
16-
go();
17-
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 4, i32 0, i64 -1)
15+
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 4, i32 0, i64 -1)
16+
go(); // probe id : 5
17+
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID]], i64 6, i32 0, i64 -1)
1818
}

llvm/include/llvm/ProfileData/SampleProf.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ struct SampleContextFrame {
466466
LineLocation Location;
467467

468468
SampleContextFrame() : Location(0, 0) {}
469-
469+
470470
SampleContextFrame(FunctionId Func, LineLocation Location)
471471
: Func(Func), Location(Location) {}
472472

@@ -527,7 +527,7 @@ class SampleContext {
527527
: Func(Name), State(UnknownContext), Attributes(ContextNone) {
528528
assert(!Name.empty() && "Name is empty");
529529
}
530-
530+
531531
SampleContext(FunctionId Func)
532532
: Func(Func), State(UnknownContext), Attributes(ContextNone) {}
533533

llvm/include/llvm/Transforms/IPO/SampleProfileProbe.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,12 @@ class SampleProfileProber {
8585
void findInvokeNormalDests(DenseSet<BasicBlock *> &InvokeNormalDests);
8686
void computeBlocksToIgnore(DenseSet<BasicBlock *> &BlocksToIgnore,
8787
DenseSet<BasicBlock *> &BlocksAndCallsToIgnore);
88-
void computeProbeIdForCallsites(
89-
const DenseSet<BasicBlock *> &BlocksAndCallsToIgnore);
9088
const Instruction *
9189
getOriginalTerminator(const BasicBlock *Head,
9290
const DenseSet<BasicBlock *> &BlocksToIgnore);
9391
void computeCFGHash(const DenseSet<BasicBlock *> &BlocksToIgnore);
94-
void computeProbeIdForBlocks(const DenseSet<BasicBlock *> &BlocksToIgnore);
95-
void computeProbeIdForCallsites();
92+
void computeProbeId(const DenseSet<BasicBlock *> &BlocksToIgnore,
93+
const DenseSet<BasicBlock *> &BlocksAndCallsToIgnore);
9694

9795
Function *F;
9896

llvm/lib/Transforms/IPO/SampleProfileProbe.cpp

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ SampleProfileProber::SampleProfileProber(Function &Func,
178178
DenseSet<BasicBlock *> BlocksAndCallsToIgnore;
179179
computeBlocksToIgnore(BlocksToIgnore, BlocksAndCallsToIgnore);
180180

181-
computeProbeIdForBlocks(BlocksToIgnore);
182-
computeProbeIdForCallsites(BlocksAndCallsToIgnore);
181+
computeProbeId(BlocksToIgnore, BlocksAndCallsToIgnore);
183182
computeCFGHash(BlocksToIgnore);
184183
}
185184

@@ -300,27 +299,20 @@ void SampleProfileProber::computeCFGHash(
300299
<< ", Hash = " << FunctionHash << "\n");
301300
}
302301

303-
void SampleProfileProber::computeProbeIdForBlocks(
304-
const DenseSet<BasicBlock *> &BlocksToIgnore) {
305-
for (auto &BB : *F) {
306-
if (BlocksToIgnore.contains(&BB))
307-
continue;
308-
BlockProbeIds[&BB] = ++LastProbeId;
309-
}
310-
}
311-
312-
void SampleProfileProber::computeProbeIdForCallsites(
302+
void SampleProfileProber::computeProbeId(
303+
const DenseSet<BasicBlock *> &BlocksToIgnore,
313304
const DenseSet<BasicBlock *> &BlocksAndCallsToIgnore) {
314305
LLVMContext &Ctx = F->getContext();
315306
Module *M = F->getParent();
316307

317308
for (auto &BB : *F) {
309+
if (!BlocksToIgnore.contains(&BB))
310+
BlockProbeIds[&BB] = ++LastProbeId;
311+
318312
if (BlocksAndCallsToIgnore.contains(&BB))
319313
continue;
320314
for (auto &I : BB) {
321-
if (!isa<CallBase>(I))
322-
continue;
323-
if (isa<IntrinsicInst>(&I))
315+
if (!isa<CallBase>(I) || isa<IntrinsicInst>(&I))
324316
continue;
325317

326318
// The current implementation uses the lower 16 bits of the discriminator
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
foo:3200:13
22
1: 13
33
2: 7
4-
3: 6
5-
4: 13
6-
5: 7 _Z3barv:2 _Z3foov:5
7-
6: 6 _Z3barv:4 _Z3foov:2
4+
4: 6
5+
6: 13
6+
3: 7 _Z3barv:2 _Z3foov:5
7+
5: 6 _Z3barv:4 _Z3foov:2
88
!CFGChecksum: 563022570642068
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
foo:3200:13
22
1: 13
33
2: 7
4-
3: 6
5-
4: 13
6-
5: 7
7-
6: 6
4+
4: 6
5+
6: 13
6+
7: 7
7+
9: 6
88
!CFGChecksum: 844530426352218

llvm/test/Transforms/SampleProfile/pseudo-probe-dangle.ll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ Merge:
2323
; JT-LABEL-NO: T
2424
; JT-LABEL-NO: F
2525
; JT-LABEL: Merge
26+
; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4
2627
; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3
27-
; JT-NOT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2
28-
; JT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
28+
; JT: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 5, i32 0, i64 -1)
29+
; ASM-NOT: .pseudoprobe 6699318081062747564 4
2930
; ASM-NOT: .pseudoprobe 6699318081062747564 3
30-
; ASM-NOT: .pseudoprobe 6699318081062747564 2
31-
; ASM: .pseudoprobe 6699318081062747564 4 0 0
31+
; ASM: .pseudoprobe 6699318081062747564 5 0 0
3232
ret i32 %call
3333
}
3434

3535
;; Check block T and F are gone, and their probes (probe 2 and 3) are gone too.
3636
; MIR-tail: bb.0
3737
; MIR-tail: PSEUDO_PROBE [[#GUID:]], 1, 0, 0
38-
; MIR-tail-NOT: PSEUDO_PROBE [[#GUID:]], 2
3938
; MIR-tail-NOT: PSEUDO_PROBE [[#GUID:]], 3
40-
; MIR-tail: PSEUDO_PROBE [[#GUID:]], 4, 0, 0
39+
; MIR-tail-NOT: PSEUDO_PROBE [[#GUID:]], 4
40+
; MIR-tail: PSEUDO_PROBE [[#GUID:]], 5, 0, 0
4141

4242

4343
define i32 @test(i32 %a, i32 %b, i32 %c) {

llvm/test/Transforms/SampleProfile/pseudo-probe-discriminator.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ attributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "fra
6262
; DEBUG: ![[INST]] = !DILocation(line: 4, column: 15, scope: ![[INSTBLOCK:[0-9]+]])
6363
; DEBUG: ![[INSTBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)
6464

65-
65+
6666
; PROBE: ![[CALL1]] = !DILocation(line: 4, column: 3, scope: ![[CALL1BLOCK:[0-9]+]])
67-
; PROBE: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 186646575)
67+
; PROBE: ![[CALL1BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 186646559)
6868
; PROBE: ![[CALL2]] = !DILocation(line: 4, column: 9, scope: ![[CALL2BLOCK:[0-9]+]])
69-
; PROBE: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 186646583)
69+
; PROBE: ![[CALL2BLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 186646567)
7070
; PROBE: ![[INST]] = !DILocation(line: 4, column: 15, scope: ![[INSTBLOCK:[0-9]+]])
7171
; PROBE: ![[INSTBLOCK]] = !DILexicalBlockFile({{.*}} discriminator: 4)

llvm/test/Transforms/SampleProfile/pseudo-probe-invoke.ll

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ entry:
1818

1919
if.then: ; preds = %entry
2020
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 2
21+
; callsite probe 3
2122
invoke void @_Z3foov()
2223
to label %invoke.cont unwind label %terminate.lpad, !dbg !24
2324

2425
invoke.cont: ; preds = %if.then
26+
; callsite probe 4
2527
; CHECK-NOT: call void @llvm.pseudoprobe(i64 -1069303473483922844,
2628
invoke void @_Z3bazv()
2729
to label %invoke.cont1 unwind label %terminate.lpad, !dbg !26
@@ -31,7 +33,8 @@ invoke.cont1: ; preds = %invoke.cont
3133
br label %if.end, !dbg !27
3234

3335
if.else: ; preds = %entry
34-
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 3
36+
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 5
37+
; callsite probe 6
3538
invoke void @_Z3foov()
3639
to label %invoke.cont2 unwind label %terminate.lpad, !dbg !28
3740

@@ -40,7 +43,8 @@ invoke.cont2: ; preds = %if.else
4043
br label %if.end
4144

4245
if.end: ; preds = %invoke.cont2, %invoke.cont1
43-
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 4
46+
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 7
47+
; callsite probe 8
4448
invoke void @_Z3foov()
4549
to label %invoke.cont3 unwind label %terminate.lpad, !dbg !29
4650

@@ -51,14 +55,14 @@ invoke.cont3: ; preds = %if.end
5155
br i1 %tobool4, label %if.then5, label %if.end6, !dbg !32
5256

5357
if.then5: ; preds = %invoke.cont3
54-
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 5
58+
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 9
5559
%2 = load volatile i32, ptr @x, align 4, !dbg !33, !tbaa !19
5660
%inc = add nsw i32 %2, 1, !dbg !33
5761
store volatile i32 %inc, ptr @x, align 4, !dbg !33, !tbaa !19
5862
br label %if.end6, !dbg !35
5963

6064
if.end6: ; preds = %if.then5, %invoke.cont3
61-
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 6
65+
; CHECK: call void @llvm.pseudoprobe(i64 -1069303473483922844, i64 10
6266
ret void, !dbg !36
6367

6468
terminate.lpad: ; preds = %if.end, %if.else, %invoke.cont, %if.then

llvm/test/Transforms/SampleProfile/pseudo-probe-profile-metadata-2.ll

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if.else:
2929
br label %return
3030

3131
return:
32-
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 4, i32 0, i64 -1)
32+
call void @llvm.pseudoprobe(i64 6699318081062747564, i64 6, i32 0, i64 -1)
3333
%1 = load i32, ptr %retval, align 4
3434
ret i32 %1
3535
}
@@ -55,13 +55,12 @@ attributes #0 = {"use-sample-profile"}
5555
!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !5, isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
5656
!10 = !{!"function_entry_count", i64 14}
5757
!11 = !{!"branch_weights", i32 100, i32 0}
58-
;; A discriminator of 186646575 which is 0x6f80057 in hexdecimal, stands for an indirect call probe
59-
;; with an index of 5 and probe factor of 1.0.
60-
!12 = !DILexicalBlockFile(scope: !4, file: !5, discriminator: 186646575)
58+
;; A discriminator of 186646559 which is 0xB20001F in hexdecimal, stands for an indirect call probe
59+
;; with an index of 3 and probe factor of 1.0.
60+
!12 = !DILexicalBlockFile(scope: !4, file: !5, discriminator: 186646559)
6161
!13 = distinct !DILocation(line: 10, column: 11, scope: !12)
62-
;; A discriminator of 134217775 which is 0x6f80057 in hexdecimal, stands for an indirect call probe
63-
;; with an index of 5 and probe factor of 0.
64-
!14 = !DILexicalBlockFile(scope: !4, file: !5, discriminator: 134217775)
62+
;; A discriminator of 134217759 which is 0x800001F in hexdecimal, stands for an indirect call probe
63+
;; with an index of 3 and probe factor of 0.
64+
!14 = !DILexicalBlockFile(scope: !4, file: !5, discriminator: 134217759)
6565
!15 = distinct !DILocation(line: 10, column: 11, scope: !14)
6666
!16 = !{!"VP", i32 0, i64 7, i64 9191153033785521275, i64 5, i64 -1069303473483922844, i64 2}
67-

llvm/test/Transforms/SampleProfile/pseudo-probe-profile.ll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ if.then:
2222
if.else:
2323
; CHECK: call {{.*}}, !dbg ![[#PROBE2:]], !prof ![[PROF2:[0-9]+]]
2424
call void %f(i32 2)
25-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3, i32 0, i64 -1)
25+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
2626
store i32 2, ptr %retval, align 4
2727
br label %return
2828

2929
return:
30-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
30+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 6, i32 0, i64 -1)
3131
%1 = load i32, ptr %retval, align 4
3232
ret i32 %1
3333
}
@@ -36,14 +36,14 @@ attributes #0 = {"use-sample-profile"}
3636

3737
; CHECK: ![[PD1]] = !{!"branch_weights", i32 8, i32 7}
3838
; CHECK: ![[#PROBE1]] = !DILocation(line: 0, scope: ![[#SCOPE1:]])
39+
;; A discriminator of 119537695 which is 0x720001f in hexdecimal, stands for an indirect call probe
40+
;; with an index of 3.
41+
; CHECK: ![[#SCOPE1]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 119537695)
42+
; CHECK: ![[PROF1]] = !{!"VP", i32 0, i64 7, i64 9191153033785521275, i64 5, i64 -1069303473483922844, i64 2}
3943
;; A discriminator of 119537711 which is 0x720002f in hexdecimal, stands for an indirect call probe
4044
;; with an index of 5.
41-
; CHECK: ![[#SCOPE1]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 119537711)
42-
; CHECK: ![[PROF1]] = !{!"VP", i32 0, i64 7, i64 9191153033785521275, i64 5, i64 -1069303473483922844, i64 2}
43-
;; A discriminator of 119537719 which is 0x7200037 in hexdecimal, stands for an indirect call probe
44-
;; with an index of 6.
4545
; CHECK: ![[#PROBE2]] = !DILocation(line: 0, scope: ![[#SCOPE2:]])
46-
; CHECK: ![[#SCOPE2]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 119537719)
46+
; CHECK: ![[#SCOPE2]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 119537711)
4747
; CHECK: ![[PROF2]] = !{!"VP", i32 0, i64 6, i64 -1069303473483922844, i64 4, i64 9191153033785521275, i64 2}
4848

4949
!llvm.module.flags = !{!9, !10}
@@ -83,7 +83,7 @@ attributes #0 = {"use-sample-profile"}
8383
;YAML-NEXT: - String: 'Applied '
8484
;YAML-NEXT: - NumSamples: '7'
8585
;YAML-NEXT: - String: ' samples from profile (ProbeId='
86-
;YAML-NEXT: - ProbeId: '5'
86+
;YAML-NEXT: - ProbeId: '3'
8787
;YAML-NEXT: - String: ', Factor='
8888
;YAML-NEXT: - Factor: '1.000000e+00'
8989
;YAML-NEXT: - String: ', OriginalSamples='
@@ -113,7 +113,7 @@ attributes #0 = {"use-sample-profile"}
113113
;YAML-NEXT: - String: 'Applied '
114114
;YAML-NEXT: - NumSamples: '6'
115115
;YAML-NEXT: - String: ' samples from profile (ProbeId='
116-
;YAML-NEXT: - ProbeId: '6'
116+
;YAML-NEXT: - ProbeId: '5'
117117
;YAML-NEXT: - String: ', Factor='
118118
;YAML-NEXT: - Factor: '1.000000e+00'
119119
;YAML-NEXT: - String: ', OriginalSamples='
@@ -128,7 +128,7 @@ attributes #0 = {"use-sample-profile"}
128128
;YAML-NEXT: - String: 'Applied '
129129
;YAML-NEXT: - NumSamples: '6'
130130
;YAML-NEXT: - String: ' samples from profile (ProbeId='
131-
;YAML-NEXT: - ProbeId: '3'
131+
;YAML-NEXT: - ProbeId: '4'
132132
;YAML-NEXT: - String: ', Factor='
133133
;YAML-NEXT: - Factor: '1.000000e+00'
134134
;YAML-NEXT: - String: ', OriginalSamples='
@@ -143,7 +143,7 @@ attributes #0 = {"use-sample-profile"}
143143
;YAML-NEXT: - String: 'Applied '
144144
;YAML-NEXT: - NumSamples: '13'
145145
;YAML-NEXT: - String: ' samples from profile (ProbeId='
146-
;YAML-NEXT: - ProbeId: '4'
146+
;YAML-NEXT: - ProbeId: '6'
147147
;YAML-NEXT: - String: ', Factor='
148148
;YAML-NEXT: - Factor: '1.000000e+00'
149149
;YAML-NEXT: - String: ', OriginalSamples='

llvm/test/Transforms/SampleProfile/pseudo-probe-update.ll

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,31 @@ T1:
1414
%v1 = call i32 @f1()
1515
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2, i32 0, i64 -1)
1616
;; The distribution factor -8513881372706734080 stands for 53.85%, whic is from 7/6+7.
17-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -8513881372706734080)
17+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 6, i32 0, i64 -8513881372706734080)
1818
%cond3 = icmp eq i32 %v1, 412
1919
br label %Merge
2020
F1:
2121
; CHECK: %v2 = call i32 @f2(), !prof ![[#PROF2:]]
2222
%v2 = call i32 @f2()
23-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 3, i32 0, i64 -1)
23+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
2424
;; The distribution factor 8513881922462547968 stands for 46.25%, which is from 6/6+7.
25-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 8513881922462547968)
25+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 6, i32 0, i64 8513881922462547968)
2626
br label %Merge
2727
Merge:
2828

2929
%A = phi i1 [%cond3, %T1], [%cond2, %F1]
3030
%B = phi i32 [%v1, %T1], [%v2, %F1]
3131
br i1 %A, label %T2, label %F2
3232
T2:
33-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 5, i32 0, i64 -1)
33+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 7, i32 0, i64 -1)
3434
call void @f3()
3535
ret i32 %B
3636
F2:
37-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 6, i32 0, i64 -1)
37+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 9, i32 0, i64 -1)
3838
ret i32 %B
3939
}
4040

4141
; CHECK: ![[#PROF1]] = !{!"branch_weights", i32 7}
4242
; CHECK: ![[#PROF2]] = !{!"branch_weights", i32 6}
4343

4444
attributes #0 = {"use-sample-profile"}
45-

llvm/test/Transforms/SampleProfile/pseudo-probe-verify.ll

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
; VERIFY: *** Pseudo Probe Verification After LoopFullUnrollPass ***
66
; VERIFY: Function foo:
7-
; VERIFY-DAG: Probe 6 previous factor 1.00 current factor 5.00
7+
; VERIFY-DAG: Probe 5 previous factor 1.00 current factor 5.00
88
; VERIFY-DAG: Probe 4 previous factor 1.00 current factor 5.00
99

1010
declare void @foo2() nounwind
@@ -27,15 +27,15 @@ bb7.preheader:
2727

2828
bb10:
2929
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
30-
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
30+
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
3131
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
32-
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
32+
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
3333
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
34-
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
34+
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
3535
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
36-
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
36+
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
3737
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 4, i32 0, i64 -1)
38-
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
38+
; CHECK: call void @foo2(), !dbg ![[#PROBE6:]]
3939
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 2, i32 0, i64 -1)
4040
%indvars.iv = phi i64 [ 0, %bb7.preheader ], [ %indvars.iv.next, %bb10 ]
4141
%tmp1.14 = phi i32 [ %tmp1.06, %bb7.preheader ], [ %spec.select, %bb10 ]
@@ -50,14 +50,14 @@ bb10:
5050
br i1 %exitcond.not, label %bb3.loopexit, label %bb10, !llvm.loop !13
5151

5252
bb24:
53-
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 5, i32 0, i64 -1)
53+
; CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 6, i32 0, i64 -1)
5454
ret void
5555
}
5656

5757
;; A discriminator of 186646583 which is 0xb200037 in hexdecimal, stands for a direct call probe
5858
;; with an index of 6 and a scale of -1%.
5959
; CHECK: ![[#PROBE6]] = !DILocation(line: 2, column: 20, scope: ![[#SCOPE:]])
60-
; CHECK: ![[#SCOPE]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 186646583)
60+
; CHECK: ![[#SCOPE]] = !DILexicalBlockFile(scope: ![[#]], file: ![[#]], discriminator: 186646575)
6161

6262
!llvm.dbg.cu = !{!0}
6363
!llvm.module.flags = !{!9, !10}

0 commit comments

Comments
 (0)