Do not rematerialize in loops.

This commit is contained in:
chriseth
2020-01-08 09:56:08 +01:00
parent 25d3f27c11
commit 40c0602b5c
10 changed files with 45 additions and 30 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ void Rematerialiser::visit(Expression& _e)
if (
(refs <= 1 && m_variableLoopDepth.at(name) == m_loopDepth) ||
cost == 0 ||
(refs <= 5 && cost <= 1) ||
(refs <= 5 && cost <= 1 && m_loopDepth == 0) ||
m_varsToAlwaysRematerialize.count(name)
)
{