From 2a8d7d97508c7be6a1f93dc01c9282026cd25fa5 Mon Sep 17 00:00:00 2001 From: Andy Ayers Date: Wed, 31 Jan 2018 14:06:59 -0800 Subject: [PATCH] JIT: add a bit more importer folding (#16111) Eagerly fold expression trees for non-branch conditional operations. Leads to elimination of boxes in some idiomatic uses. See notes and examples in #14472. --- src/jit/importer.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/jit/importer.cpp b/src/jit/importer.cpp index 0c7b560..4c3ea55 100644 --- a/src/jit/importer.cpp +++ b/src/jit/importer.cpp @@ -12054,6 +12054,9 @@ void Compiler::impImportBlockCode(BasicBlock* block) op1->gtFlags |= GTF_RELOP_NAN_UN | GTF_UNSIGNED; } + // Fold result, if possible. + op1 = gtFoldExpr(op1); + impPushOnStack(op1, tiRetVal); break; -- 2.7.4