Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions src/coreclr/jit/importercalls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3642,14 +3642,14 @@ GenTree* Compiler::impIntrinsic(CORINFO_CLASS_HANDLE clsHnd,
if (op1->OperIsConst() || gtIsTypeof(op1))
{
// op1 is a known constant, replace with 'true'.
retNode = gtNewIconNode(1);
retNode = gtNewTrue();
JITDUMP("\nExpanding RuntimeHelpers.IsKnownConstant to true early\n");
// We can also consider FTN_ADDR here
}
else if (opts.OptimizationDisabled())
{
// It doesn't make sense to carry it as GT_INTRINSIC till Morph in Tier0
retNode = gtNewIconNode(0);
retNode = gtNewFalse();
JITDUMP("\nExpanding RuntimeHelpers.IsKnownConstant to false early\n");
}
else
Expand Down
6 changes: 4 additions & 2 deletions src/coreclr/jit/morph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8419,12 +8419,14 @@ GenTree* Compiler::fgMorphSmpOp(GenTree* tree, MorphAddrContext* mac, bool* optA
// We're lucky to catch a constant here while importer was not
JITDUMP("true\n");
DEBUG_DESTROY_NODE(tree, op1);
tree = gtNewIconNode(1);
tree = gtNewTrue();
}
else
{
JITDUMP("false\n");
tree = gtWrapWithSideEffects(gtNewIconNode(0), op1, GTF_ALL_EFFECT);
tree = gtNewFalse();
tree->SetMorphed(this);
tree = gtWrapWithSideEffects(tree, op1, GTF_ALL_EFFECT);
}
tree->SetMorphed(this);
return tree;
Expand Down
Loading