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

Commit 2a8d7d9

Browse files
authored
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.
1 parent 7512213 commit 2a8d7d9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jit/importer.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12054,6 +12054,9 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1205412054
op1->gtFlags |= GTF_RELOP_NAN_UN | GTF_UNSIGNED;
1205512055
}
1205612056

12057+
// Fold result, if possible.
12058+
op1 = gtFoldExpr(op1);
12059+
1205712060
impPushOnStack(op1, tiRetVal);
1205812061
break;
1205912062

0 commit comments

Comments
 (0)