Skip to content

Commit

Permalink
Address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo committed Mar 18, 2023
1 parent 8c1d7c7 commit 250ce6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9991,8 +9991,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA
if (tree->AsIntrinsic()->gtIntrinsicName ==
NI_System_Runtime_CompilerServices_RuntimeHelpers_IsKnownConstant)
{
// Should be expanded by the time it reaches CSE phase
assert(!optValnumCSE_phase);
// It's expected to be folded in importer if opts aren't allowed
assert(opts.OptimizationEnabled());

JITDUMP("\nExpanding RuntimeHelpers.IsKnownConstant to ");
Expand All @@ -10015,7 +10014,7 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA
JITDUMP("false with side effects:\n")
DISPTREE(tree);
}
else if (op1->OperIs(GT_LCL_VAR))
else if (op1->OperIsLocal())
{
// Give it one last chance to be folded in VN/ConstProp.
// Limitted to locals for TP reasons, can be relaxed if needed
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/jit/valuenum.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11050,9 +11050,9 @@ void Compiler::fgValueNumberIntrinsic(GenTree* tree)
}
else if (intrinsic->gtIntrinsicName == NI_System_Runtime_CompilerServices_RuntimeHelpers_IsKnownConstant)
{
bool isKnownConstant = arg0VNP.BothEqual() && vnStore->IsVNConstant(arg0VNP.GetLiberal());
ValueNum isCnsVN = vnStore->VNForIntCon(isKnownConstant ? 1 : 0);
intrinsic->gtVNPair = vnStore->VNPWithExc(ValueNumPair(isCnsVN, isCnsVN), arg0VNPx);
ValueNumPair isCnsVNP(vnStore->VNForIntCon(vnStore->IsVNConstant(arg0VNP.GetLiberal()) ? 1 : 0),
vnStore->VNForIntCon(vnStore->IsVNConstant(arg0VNP.GetConservative()) ? 1 : 0));
intrinsic->gtVNPair = vnStore->VNPWithExc(ValueNumPair(isCnsVN, isCnsVN), arg0VNPx);
}
else
{
Expand Down

0 comments on commit 250ce6d

Please sign in to comment.