JIT: add OSR patchpoint strategy, inhibit tail duplication (#66208)
authorAndy Ayers <andya@microsoft.com>
Sun, 6 Mar 2022 16:26:43 +0000 (08:26 -0800)
committerGitHub <noreply@github.com>
Sun, 6 Mar 2022 16:26:43 +0000 (08:26 -0800)
commitf9da3db92420d15b5bba283a44271cd81d83ad1a
tree704c684a07d31bba1735f8227a5058b00fa236d6
parent6fce82cb7b111ba9a2547b70b4592cea98ae314e
JIT: add OSR patchpoint strategy, inhibit tail duplication (#66208)

Two changes for OSR:
* add new strategies for placing patchpoints -- either at
  backedge sources (instead of targets) or adaptive. depending
  on number of backedges. Change default to adaptive, since this
  works better with the flow we see from C# `for` loops.
* inhibit tail duplication for OSR as it may end up interfering
  with loop recognition.

We may not be able to place patchpoints at sources, for various reasons;
if so we fall back to placing them at targets.

We also can't place patchpoints unless block entries are also stack empty
ponts. This means forgoing patchpoints in some IL cases..
src/coreclr/jit/block.cpp
src/coreclr/jit/block.h
src/coreclr/jit/fgbasic.cpp
src/coreclr/jit/fgopt.cpp
src/coreclr/jit/importer.cpp
src/coreclr/jit/jitconfigvalues.h
src/coreclr/jit/jiteh.cpp