Various optimizations for the DataFlowAnalyzer.

This commit is contained in:
Daniel Kirchner
2021-01-12 21:39:20 +01:00
parent e9dcd4f813
commit 625d402dbb
8 changed files with 89 additions and 112 deletions
+8 -11
View File
@@ -65,15 +65,12 @@ void LoadResolver::tryResolve(
return;
YulString key = std::get<Identifier>(_arguments.at(0)).name;
if (
_location == StoreLoadLocation::Storage &&
m_storage.values.count(key)
)
_e = Identifier{locationOf(_e), m_storage.values[key]};
else if (
m_optimizeMLoad &&
_location == StoreLoadLocation::Memory &&
m_memory.values.count(key)
)
_e = Identifier{locationOf(_e), m_memory.values[key]};
if (_location == StoreLoadLocation::Storage)
{
if (auto value = m_storage.fetch(key))
_e = Identifier{locationOf(_e), *value};
}
else if (m_optimizeMLoad && _location == StoreLoadLocation::Memory)
if (auto value = m_memory.fetch(key))
_e = Identifier{locationOf(_e), *value};
}