mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tune Rematerializer
This commit is contained in:
@@ -78,7 +78,12 @@ void Rematerialiser::visit(Expression& _e)
|
||||
auto const& value = *m_value.at(name);
|
||||
size_t refs = m_referenceCounts[name];
|
||||
size_t cost = CodeCost::codeCost(m_dialect, value);
|
||||
if (refs <= 1 || cost == 0 || (refs <= 5 && cost <= 1) || m_varsToAlwaysRematerialize.count(name))
|
||||
if (
|
||||
(refs <= 1 && m_variableLoopDepth.at(name) == m_loopDepth) ||
|
||||
cost == 0 ||
|
||||
(refs <= 5 && cost <= 1) ||
|
||||
m_varsToAlwaysRematerialize.count(name)
|
||||
)
|
||||
{
|
||||
assertThrow(m_referenceCounts[name] > 0, OptimizerException, "");
|
||||
for (auto const& ref: m_references.forward[name])
|
||||
|
||||
Reference in New Issue
Block a user