JIT: Insert writebacks more eagerly (#87869)
authorJakob Botsch Nielsen <Jakob.botsch.nielsen@gmail.com>
Fri, 23 Jun 2023 22:41:44 +0000 (00:41 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Jun 2023 22:41:44 +0000 (00:41 +0200)
commit8b2dc46f50f1e0da47979b5a45da2ddfd4d68f13
tree43463b6eae3e5b8caf8fd8a67b4ced06ff9ea5f6
parente2c1534f9f71bb7c9b654e17e01fcd107f9b645a
JIT: Insert writebacks more eagerly (#87869)

Before starting replacements within a statement we now look for
physically promoted struct locals passed as call args and write those
back if necessary. This has two benefits:
1. It avoids creating a lot of comma nodes that we would otherwise
   create
2. More importantly, it allows morph's last-use copy omission to kick in
   because we no longer have complex trees as the argument.

Fix #87471
src/coreclr/jit/promotion.cpp
src/coreclr/jit/promotion.h
src/coreclr/jit/promotiondecomposition.cpp