-
Notifications
You must be signed in to change notification settings - Fork 5.2k
JIT: Make BB_UNITY_WEIGHT
1.0
#112151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
JIT: Make BB_UNITY_WEIGHT
1.0
#112151
Changes from all commits
c00ed34
d8932db
16abfce
abc2160
156252d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2406,7 +2406,7 @@ void CSE_HeuristicParameterized::CaptureLocalWeights() | |||||
} | ||||||
|
||||||
JITDUMP("V%02u," FMT_WT "\n", m_pCompiler->lvaGetLclNum(varDsc), varDsc->lvRefCntWtd()); | ||||||
m_localWeights->push_back(varDsc->lvRefCntWtd() / BB_UNITY_WEIGHT); | ||||||
m_localWeights->push_back(varDsc->lvRefCntWtd()); | ||||||
} | ||||||
} | ||||||
|
||||||
|
@@ -4400,7 +4400,7 @@ bool CSE_Heuristic::PromotionCheck(CSE_Candidate* candidate) | |||||
weight_t no_cse_cost = 0; | ||||||
weight_t yes_cse_cost = 0; | ||||||
unsigned extra_yes_cost = 0; | ||||||
unsigned extra_no_cost = 0; | ||||||
weight_t extra_no_cost = 0; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable type has been changed from
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
|
||||||
// The 'cseRefCnt' is the RefCnt that we will have if we promote this CSE into a new LclVar | ||||||
// Each CSE Def will contain two Refs and each CSE Use will have one Ref of this new LclVar | ||||||
|
@@ -4724,6 +4724,8 @@ bool CSE_Heuristic::PromotionCheck(CSE_Candidate* candidate) | |||||
// weighted count | ||||||
extra_no_cost = candidate->Size() - cse_use_cost; | ||||||
extra_no_cost = extra_no_cost * dsc->csdUseCount * 2; | ||||||
// TODO-BB-UNITY-WEIGHT: Remove? | ||||||
extra_no_cost /= 100; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hardcoded division by 100 appears to be a temporary workaround based on the TODO comment. Consider replacing the magic number 100 with a named constant or removing this scaling entirely if it's no longer needed after the BB_UNITY_WEIGHT changes.
Suggested change
Copilot uses AI. Check for mistakes. Positive FeedbackNegative Feedback |
||||||
} | ||||||
|
||||||
/* no_cse_cost is the cost estimate when we decide not to make a CSE */ | ||||||
|
@@ -4741,7 +4743,7 @@ bool CSE_Heuristic::PromotionCheck(CSE_Candidate* candidate) | |||||
printf("cseRefCnt=%f, aggressiveRefCnt=%f, moderateRefCnt=%f\n", cseRefCnt, aggressiveRefCnt, moderateRefCnt); | ||||||
printf("defCnt=%f, useCnt=%f, cost=%d, size=%d%s\n", candidate->DefCount(), candidate->UseCount(), | ||||||
candidate->Cost(), candidate->Size(), candidate->LiveAcrossCall() ? ", LiveAcrossCall" : ""); | ||||||
printf("def_cost=%d, use_cost=%d, extra_no_cost=%d, extra_yes_cost=%d\n", cse_def_cost, cse_use_cost, | ||||||
printf("def_cost=%d, use_cost=%d, extra_no_cost=%f, extra_yes_cost=%d\n", cse_def_cost, cse_use_cost, | ||||||
extra_no_cost, extra_yes_cost); | ||||||
|
||||||
printf("CSE cost savings check (%f >= %f) %s\n", no_cse_cost, yes_cse_cost, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The threshold has been changed from 99999 to 999.99, but the comment still refers to '6 characters'. With the new threshold, weights like 1000.00 would be 7 characters, making the comment inaccurate. Update the comment to reflect the actual character count logic.
Copilot uses AI. Check for mistakes.