Skip to content

Commit 2737da5

Browse files
authored
JIT: enable reading PGO data when switching to optimized (#66618)
When QuickJitForLoops=0 (current default) and the JIT sees a Tier0 method with a loop, it will switch to optimizing the method instead. When this happens we should also have set `BBOPT` so that the JIT will read and incorporate PGO data for the method and/or its inliees. But we were not doing that. This change sets `BBOPT`.
1 parent 6bf873a commit 2737da5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/coreclr/jit/flowgraph.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,7 @@ void Compiler::fgSwitchToOptimized(const char* reason)
521521
opts.jitFlags->Clear(JitFlags::JIT_FLAG_TIER0);
522522
opts.jitFlags->Clear(JitFlags::JIT_FLAG_BBINSTR);
523523
opts.jitFlags->Clear(JitFlags::JIT_FLAG_OSR);
524+
opts.jitFlags->Set(JitFlags::JIT_FLAG_BBOPT);
524525

525526
// Leave a note for jit diagnostics
526527
compSwitchedToOptimized = true;

0 commit comments

Comments
 (0)