Move a morph opt to post-order (#69984)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Fri, 10 Jun 2022 20:31:59 +0000 (22:31 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Jun 2022 20:31:59 +0000 (22:31 +0200)
commitb22fcf4e7bac2a61413509b36cb4ba3b0c864c2f
tree34284ee2745d56e4a2ec2bc4adce35eb43d0a0fd
parentfae7ee8e7e3aa7f86836318a10ed676641e813ad
Move a morph opt to post-order (#69984)

When changing the shape of child nodes in pre-order we must ensure we properly morph
potential promoted/demoted child nodes. Normally this happens inside
fgMorphTree which does it for child nodes, but this specific transform was not
calling fgMorphTree on the parent tree after changing the shape of child nodes.

The simplest fix is just to move the optimization to post-order which catches more cases and does not need to bother dealing with this.

Fix #61074
src/coreclr/jit/morph.cpp
src/tests/JIT/Regression/JitBlue/Runtime_61074/Runtime_61074.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_61074/Runtime_61074.csproj [new file with mode: 0644]