diff --git a/src/coreclr/jit/importercalls.cpp b/src/coreclr/jit/importercalls.cpp index 4214b08958748d..a4e2e454b96616 100644 --- a/src/coreclr/jit/importercalls.cpp +++ b/src/coreclr/jit/importercalls.cpp @@ -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 diff --git a/src/coreclr/jit/morph.cpp b/src/coreclr/jit/morph.cpp index db5443b8b26796..a4f09b64f6213a 100644 --- a/src/coreclr/jit/morph.cpp +++ b/src/coreclr/jit/morph.cpp @@ -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;