Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix build
  • Loading branch information
EgorBo committed Jan 17, 2024
commit 2c72dea30277bc4f91b56a050b8e00b985de9ff7
5 changes: 3 additions & 2 deletions src/coreclr/jit/gentree.h
Original file line number Diff line number Diff line change
Expand Up @@ -5588,8 +5588,9 @@ struct GenTreeCall final : public GenTree

CORINFO_CLASS_HANDLE gtRetClsHnd; // The return type handle of the call if it is a struct; always available
union {
void* gtStubCallStubAddr; // GTF_CALL_VIRT_STUB - these are never inlined
CORINFO_CLASS_HANDLE gtInitClsHnd; // Used by static init helpers, represents a class they init
void* gtStubCallStubAddr; // GTF_CALL_VIRT_STUB - these are never inlined
CORINFO_CLASS_HANDLE gtInitClsHnd; // Used by static init helpers, represents a class they init
IL_OFFSET gtCastHelperILOffset; // Used by cast helpers to save corresponding IL offset
};

union {
Expand Down
10 changes: 5 additions & 5 deletions src/coreclr/jit/helperexpansion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1594,7 +1594,7 @@ bool Compiler::fgLateCastExpansionForCall(BasicBlock** pBlock, Statement* stmt,
const int maxLikelyClasses = 8;
LikelyClassMethodRecord likelyClasses[maxLikelyClasses];
unsigned likelyClassCount = getLikelyClasses(likelyClasses, maxLikelyClasses, fgPgoSchema, fgPgoSchemaCount,
fgPgoData, (int)call->gtRawILOffset);
fgPgoData, call->gtCastHelperILOffset);

if (likelyClassCount == 0)
{
Expand Down Expand Up @@ -1720,7 +1720,7 @@ bool Compiler::fgLateCastExpansionForCall(BasicBlock** pBlock, Statement* stmt,
// typeCheckBb (BBJ_COND): [weight: 0.5]
// if (tmp->pMT == likelyClass) goto block;
//
// fallbackBb (BBJ_ALWAYS): [weight: 0.25]
// fallbackBb (BBJ_ALWAYS): [weight: <profile>]
// tmp = helper_call(cls, tmp);
//
// block (BBJ_any): [weight: 1.0]
Expand Down Expand Up @@ -1786,12 +1786,12 @@ bool Compiler::fgLateCastExpansionForCall(BasicBlock** pBlock, Statement* stmt,

//
// Re-distribute weights
// We assume obj is 50%/50% null/not-null, and if it's not null,
// it's 50%/50% of being of the expected type. TODO: rely on profile data
// We assume obj is 50%/50% null/not-null (TODO: use profile data)
// and rely on profile for the slow path.
//
nullcheckBb->inheritWeight(prevBb);
fallbackBb->inheritWeightPercentage(nullcheckBb, 50);
typeCheckBb->inheritWeightPercentage(fallbackBb, 50);
typeCheckBb->inheritWeightPercentage(fallbackBb, 100 - likelyClass.likelihood);
block->inheritWeight(prevBb);

//
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/jit/importer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5603,9 +5603,9 @@ GenTree* Compiler::impCastClassOrIsInstToTree(
}
else
{
// Maybe the late-cast-expand phase can have a better luck expanding this cast.
// Maybe the late-cast-expand phase will have a better luck expanding this cast.
call->gtCallMoreFlags |= GTF_CALL_M_CAST_CAN_BE_EXPANDED;
call->gtRawILOffset = ilOffset;
call->gtCastHelperILOffset = ilOffset;
}
return call;
}
Expand Down