mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Make ReasoningBasedSimplifier available as step.
This commit is contained in:
parent
2d7e28769a
commit
9bcc2f1713
@ -41,6 +41,7 @@
|
|||||||
#include <libyul/optimiser/ForLoopConditionOutOfBody.h>
|
#include <libyul/optimiser/ForLoopConditionOutOfBody.h>
|
||||||
#include <libyul/optimiser/ForLoopInitRewriter.h>
|
#include <libyul/optimiser/ForLoopInitRewriter.h>
|
||||||
#include <libyul/optimiser/ForLoopConditionIntoBody.h>
|
#include <libyul/optimiser/ForLoopConditionIntoBody.h>
|
||||||
|
#include <libyul/optimiser/ReasoningBasedSimplifier.h>
|
||||||
#include <libyul/optimiser/Rematerialiser.h>
|
#include <libyul/optimiser/Rematerialiser.h>
|
||||||
#include <libyul/optimiser/UnusedFunctionParameterPruner.h>
|
#include <libyul/optimiser/UnusedFunctionParameterPruner.h>
|
||||||
#include <libyul/optimiser/UnusedPruner.h>
|
#include <libyul/optimiser/UnusedPruner.h>
|
||||||
@ -184,6 +185,7 @@ map<string, unique_ptr<OptimiserStep>> const& OptimiserSuite::allSteps()
|
|||||||
LoopInvariantCodeMotion,
|
LoopInvariantCodeMotion,
|
||||||
NameSimplifier,
|
NameSimplifier,
|
||||||
RedundantAssignEliminator,
|
RedundantAssignEliminator,
|
||||||
|
ReasoningBasedSimplifier,
|
||||||
Rematerialiser,
|
Rematerialiser,
|
||||||
SSAReverser,
|
SSAReverser,
|
||||||
SSATransform,
|
SSATransform,
|
||||||
@ -221,6 +223,7 @@ map<string, char> const& OptimiserSuite::stepNameToAbbreviationMap()
|
|||||||
{LoadResolver::name, 'L'},
|
{LoadResolver::name, 'L'},
|
||||||
{LoopInvariantCodeMotion::name, 'M'},
|
{LoopInvariantCodeMotion::name, 'M'},
|
||||||
{NameSimplifier::name, 'N'},
|
{NameSimplifier::name, 'N'},
|
||||||
|
{ReasoningBasedSimplifier::name, 'R'},
|
||||||
{RedundantAssignEliminator::name, 'r'},
|
{RedundantAssignEliminator::name, 'r'},
|
||||||
{Rematerialiser::name, 'm'},
|
{Rematerialiser::name, 'm'},
|
||||||
{SSAReverser::name, 'V'},
|
{SSAReverser::name, 'V'},
|
||||||
|
@ -158,8 +158,7 @@ public:
|
|||||||
map<char, string> const& extraOptions = {
|
map<char, string> const& extraOptions = {
|
||||||
{'#', "quit"},
|
{'#', "quit"},
|
||||||
{',', "VarNameCleaner"},
|
{',', "VarNameCleaner"},
|
||||||
{';', "StackCompressor"},
|
{';', "StackCompressor"}
|
||||||
{'R', "ReasoningBasedSimplifier"}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
printUsageBanner(abbreviationMap, extraOptions, 4);
|
printUsageBanner(abbreviationMap, extraOptions, 4);
|
||||||
@ -192,12 +191,6 @@ public:
|
|||||||
StackCompressor::run(m_dialect, obj, true, 16);
|
StackCompressor::run(m_dialect, obj, true, 16);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'R':
|
|
||||||
{
|
|
||||||
ReasoningBasedSimplifier::run(context, *m_ast);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
cerr << "Unknown option." << endl;
|
cerr << "Unknown option." << endl;
|
||||||
}
|
}
|
||||||
|
@ -138,7 +138,7 @@ BOOST_AUTO_TEST_CASE(output_operator_should_create_concise_and_unambiguous_strin
|
|||||||
|
|
||||||
BOOST_TEST(chromosome.length() == allSteps.size());
|
BOOST_TEST(chromosome.length() == allSteps.size());
|
||||||
BOOST_TEST(chromosome.optimisationSteps() == allSteps);
|
BOOST_TEST(chromosome.optimisationSteps() == allSteps);
|
||||||
BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighTLMNrmVatpud");
|
BOOST_TEST(toString(chromosome) == "flcCUnDvejsxIOoighTLMNRrmVatpud");
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(optimisationSteps_should_translate_chromosomes_genes_to_optimisation_step_names)
|
BOOST_AUTO_TEST_CASE(optimisationSteps_should_translate_chromosomes_genes_to_optimisation_step_names)
|
||||||
|
Loading…
Reference in New Issue
Block a user