Skip to content

Commit 0ef01c2

Browse files
committed
Make sure we don't do optimizations when we shouldn't
1 parent 4fca081 commit 0ef01c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/coreclr/jit/morph.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -11208,6 +11208,11 @@ GenTree* Compiler::fgOptimizeHWIntrinsic(GenTreeHWIntrinsic* node)
1120811208
}
1120911209
}
1121011210

11211+
if (!fgGlobalMorph)
11212+
{
11213+
return node;
11214+
}
11215+
1121111216
switch (oper)
1121211217
{
1121311218
case GT_ADD:
@@ -11359,7 +11364,7 @@ GenTree* Compiler::fgOptimizeCommutativeArithmetic(GenTreeOp* tree)
1135911364
{
1136011365
// TODO-Review: We used to assert here that "(!op2->OperIsConst() || !opts.OptEnabled(CLFLG_CONSTANTFOLD))".
1136111366
// This may indicate a missed "remorph". Task is to re-enable this assertion and investigate.
11362-
11367+
std::swap(tree->gtOp1, tree->gtOp2);
1136311368
}
1136411369

1136511370
if (fgOperIsBitwiseRotationRoot(tree->OperGet()))

0 commit comments

Comments
 (0)