Skip to content

Commit

Permalink
JIT: Skip tailcall IR validation for struct calls (#96719)
Browse files Browse the repository at this point in the history
When structs are involved the correct return patterns can be very
complex if they involve decomposed field stores produced by physical
promotion. Skip the validation for these cases.
  • Loading branch information
jakobbotsch authored Jan 10, 2024
1 parent 8269cd3 commit e5bab5f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6340,10 +6340,19 @@ GenTree* Compiler::fgMorphPotentialTailCall(GenTreeCall* call)
// Notes:
// This function needs to handle somewhat complex IR that appears after
// tailcall candidates due to inlining.
// Does not support checking struct returns since physical promotion can
// create very hard to validate IR patterns.
//
void Compiler::fgValidateIRForTailCall(GenTreeCall* call)
{
#ifdef DEBUG
if (call->TypeIs(TYP_STRUCT))
{
// Due to struct fields it can be very hard to track valid return
// patterns; just give up on validating those.
return;
}

class TailCallIRValidatorVisitor final : public GenTreeVisitor<TailCallIRValidatorVisitor>
{
GenTreeCall* m_tailcall;
Expand Down

0 comments on commit e5bab5f

Please sign in to comment.