From 872601ce876c5e3029f145be43884a1c5116b6a8 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Mon, 12 Apr 2021 19:03:33 -0700 Subject: [PATCH] JIT: remove guarded devirtualization restriction for small struct returns Now that we're not retyping small structs, the existing transformation works for methods returning small structs too. Fixes #51138. --- src/coreclr/jit/indirectcalltransformer.cpp | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/coreclr/jit/indirectcalltransformer.cpp b/src/coreclr/jit/indirectcalltransformer.cpp index 8699d898cf3688..dba33e0ff8116e 100644 --- a/src/coreclr/jit/indirectcalltransformer.cpp +++ b/src/coreclr/jit/indirectcalltransformer.cpp @@ -523,25 +523,6 @@ class IndirectCallTransformer return; } - // For now, bail on transforming calls that still appear - // to return structs by value as there is deferred work - // needed to fix up the return type. - // - // See for instance fgUpdateInlineReturnExpressionPlaceHolder. - if (origCall->TypeGet() == TYP_STRUCT) - { - JITDUMP("*** %s Bailing on [%06u] -- can't handle by-value struct returns yet\n", Name(), - compiler->dspTreeID(origCall)); - ClearFlag(); - - // For stub calls restore the stub address - if (origCall->IsVirtualStub()) - { - origCall->gtStubCallStubAddr = origCall->gtInlineCandidateInfo->stubAddr; - } - return; - } - likelihood = origCall->gtGuardedDevirtualizationCandidateInfo->likelihood; assert((likelihood >= 0) && (likelihood <= 100)); JITDUMP("Likelihood of correct guess is %u\n", likelihood);