JIT: fgMorphModToSubMulDiv should not reorder operands (#65118)
authorAndy Ayers <andya@microsoft.com>
Fri, 11 Feb 2022 16:06:35 +0000 (08:06 -0800)
committerGitHub <noreply@github.com>
Fri, 11 Feb 2022 16:06:35 +0000 (08:06 -0800)
commitf3eaf31dd65dbc96134beb234eaf14dc1c5c0202
treebb7295fe4492b62d80952ee24c31afac964acb02
parent6bf42eb74e211c78ecc88a482baca4aa3acff96d
JIT: fgMorphModToSubMulDiv should not reorder operands (#65118)

There was existing logic to spill but it was there to avoid duplicating costly trees and was
not considering possible interference. Unfortunately, this method is invoked in morph
preorder and child node flags can't be trusted for interference checks.

Fix is to update `fgMakeMultiUse` so it will spill any exposed local.
src/coreclr/jit/morph.cpp
src/tests/JIT/opt/ForwardSub/modOpt.cs [new file with mode: 0644]
src/tests/JIT/opt/ForwardSub/modOpt.csproj [new file with mode: 0644]