Fix heap live-in calculation
authorJoseph Tremoulet <jotrem@microsoft.com>
Fri, 30 Dec 2016 16:54:56 +0000 (08:54 -0800)
committerJoseph Tremoulet <jotrem@microsoft.com>
Fri, 30 Dec 2016 19:13:08 +0000 (14:13 -0500)
commit5fc45e1cc3fb6243c49b70d9938013ffa6d804d4
treec5962d89cd94cc9c0b2798cffa9ba59234b5cc5e
parent3c4e8a1c9e815a1d008a487e9e71a56c189ed98e
Fix heap live-in calculation

Update the code in liveness that sets the `fgCurHeapUse` flag (which needs
to identify whether the current block has an upwards-exposed use of the
heap) to set this unconditionally for opcodes that use the heap.
Previously, this code was avoiding setting the flag if the block has a
prior def of the heap, but in the absence of a guarantee to the contrary,
we must assume that the heap use may not alias the heap def, and so still
be upwards-exposed and cause the heap to be live-in to the block.

Also remove the OptRepeat workaround for the lack of this, in
`ResetOptAnnotations`.

Fixes dotnet/coreclr#7846.

Commit migrated from https://github.com/dotnet/coreclr/commit/d8e66b969c31360f89ac6afa9008fd8cf85219aa
src/coreclr/src/jit/compiler.cpp
src/coreclr/src/jit/liveness.cpp