Fix inter-block heap-live-in calculation
authorJoseph Tremoulet <jotrem@microsoft.com>
Tue, 17 Jan 2017 19:42:24 +0000 (14:42 -0500)
committerJoseph Tremoulet <jotrem@microsoft.com>
Wed, 18 Jan 2017 17:58:51 +0000 (12:58 -0500)
Similar to the intra-block case fixed in #8757, without proving that a
heap def completely covers a subsequent heap use, we must propagate heap
liveness up past the heap def.  Fix failure to so propagate liveness in
`LiveVarAnalysis::PerBlockAnalysis`.

src/jit/liveness.cpp

index 0d47716..569debb 100644 (file)
@@ -1129,7 +1129,9 @@ class LiveVarAnalysis
         VarSetOps::DiffD(m_compiler, m_liveIn, block->bbVarDef);
         VarSetOps::UnionD(m_compiler, m_liveIn, block->bbVarUse);
 
-        m_heapLiveIn = (m_heapLiveOut && !block->bbHeapDef) || block->bbHeapUse;
+        // Even if m_heapDef is set, we must assume that it doesn't kill heap if m_heapLiveOut, since
+        // (without proof otherwise) the use and def may touch different heap memory at run-time.
+        m_heapLiveIn = m_heapLiveOut || block->bbHeapUse;
 
         /* Can exceptions from this block be handled (in this function)? */