diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index b5fb3d20759762..39a0852f71988f 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -7132,15 +7132,11 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call) return nullptr; } - // Heuristic: regular calls to noreturn methods can sometimes be - // merged, so if we have multiple such calls, we defer tail calling. - // - // TODO: re-examine this; now that we're merging before morph we - // don't need to worry about interfering with merges. - // - if (call->IsNoReturn() && (optNoReturnCallCount > 1)) + if (call->IsNoReturn() && !call->IsTailPrefixedCall()) { - failTailCall("Defer tail calling throw helper; anticipating merge"); + // Such tail calls always throw an exception and we won't be able to see current + // Caller() in the stacktrace. + failTailCall("Never returns"); return nullptr; }