Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions libyul/optimiser/SSAValueTracker.h

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you may want to try the new boost-unordered-containers that sean recently pull-requested here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed in a separated commit. I will prepare comparison soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took longer than expected. I had to run on 20 iterations and add MAD (Median Absolut Deviation) to filter out outliers. Results below.

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <libyul/optimiser/ASTWalker.h>
#include <libyul/AST.h> // Needed for m_zero below.

#include <map>
#include <libsolutil/UnorderedContainers.h>
#include <set>

namespace solidity::yul
Expand All @@ -47,7 +47,7 @@ class SSAValueTracker: public ASTWalker
void operator()(VariableDeclaration const& _varDecl) override;
void operator()(Assignment const& _assignment) override;

std::map<YulName, Expression const*> const& values() const { return m_values; }
util::unordered_flat_map<YulName, Expression const*> const& values() const { return m_values; }
Expression const* value(YulName _name) const { return m_values.at(_name); }

static std::set<YulName> ssaVariables(Block const& _ast);
Expand All @@ -58,7 +58,7 @@ class SSAValueTracker: public ASTWalker
/// Special expression whose address will be used in m_values.
/// YulName does not need to be reset because SSAValueTracker is short-lived.
Expression const m_zero{Literal{{}, LiteralKind::Number, LiteralValue(u256{0})}};
std::map<YulName, Expression const*> m_values;
util::unordered_flat_map<YulName, Expression const*> m_values;
};

}