Remove call to morph on hoisted trees (#86450)
authorBruce Forstall <brucefo@microsoft.com>
Thu, 18 May 2023 19:05:56 +0000 (12:05 -0700)
committerGitHub <noreply@github.com>
Thu, 18 May 2023 19:05:56 +0000 (12:05 -0700)
It is unnecessary (this causes no diffs). And theoretically if it
did cause diffs, the morphed tree would then not match the tree
being hoisted, meaning CSE wouldn't "find" it and consider it a CSE.

src/coreclr/jit/optimizer.cpp

index 59a0cc8..d425f55 100644 (file)
@@ -6511,11 +6511,6 @@ void Compiler::optPerformHoistExpr(GenTree* origExpr, BasicBlock* exprBb, unsign
 
     BasicBlock* preHead = optLoopTable[lnum].lpHead;
 
-    // fgMorphTree requires that compCurBB be the block that contains
-    // (or in this case, will contain) the expression.
-    compCurBB = preHead;
-    hoist     = fgMorphTree(hoist);
-
     // Scan the tree for any new SSA uses.
     //
     optRecordSsaUses(hoist, preHead);