Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 39fbf97

Browse files
author
Viacheslav Nikolaev
committed
The sort for CSE size optimization should be different from the execution optimization
1 parent 3c2ac22 commit 39fbf97

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/jit/optcse.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,19 +405,19 @@ int __cdecl Compiler::optCSEcostCmpSz(const void *op1, const void *op2)
405405

406406
int diff;
407407

408-
diff = (int)(exp2->gtCostEx - exp1->gtCostEx);
408+
diff = (int)(exp2->gtCostSz - exp1->gtCostSz);
409409

410410
if (diff != 0)
411411
return diff;
412412

413413
// Sort the higher Use Counts toward the top
414-
diff = (int)(dsc2->csdUseWtCnt - dsc1->csdUseWtCnt);
414+
diff = (int)(dsc2->csdUseCount - dsc1->csdUseCount);
415415

416416
if (diff != 0)
417417
return diff;
418418

419419
// With the same use count, Sort the lower Def Counts toward the top
420-
diff = (int)(dsc1->csdDefWtCnt - dsc2->csdDefWtCnt);
420+
diff = (int)(dsc1->csdDefCount - dsc2->csdDefCount);
421421

422422
if (diff != 0)
423423
return diff;

0 commit comments

Comments
 (0)