Skip to content

Commit dec0f8a

Browse files
Delete morph transform
1 parent 43dd0a7 commit dec0f8a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/coreclr/jit/morph.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13073,9 +13073,8 @@ GenTree* Compiler::fgOptimizeAddition(GenTreeOp* add)
1307313073
DEBUG_DESTROY_NODE(constTwo);
1307413074
}
1307513075

13076-
// Fold (x + 0) - given it won't change the tree type to TYP_REF.
13077-
// TODO-Bug: this code will lose the GC-ness of a tree like "native int + byref(0)".
13078-
if (op2->IsIntegralConst(0) && ((add->TypeGet() == op1->TypeGet()) || !op1->TypeIs(TYP_REF)))
13076+
// Fold (x + 0) - given it won't change the tree type.
13077+
if (op2->IsIntegralConst(0) && (genActualType(add) == genActualType(op1)))
1307913078
{
1308013079
if (op2->IsCnsIntOrI() && varTypeIsI(op1))
1308113080
{

0 commit comments

Comments
 (0)