summaryrefslogtreecommitdiff
path: root/src/pass.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pass.h')
-rw-r--r--src/pass.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/pass.h b/src/pass.h
index 6769c91ee..041b80321 100644
--- a/src/pass.h
+++ b/src/pass.h
@@ -95,6 +95,11 @@ struct InliningOptions {
Index partialInliningIfs = 0;
};
+// Forward declaration for FuncEffectsMap.
+class EffectAnalyzer;
+
+using FuncEffectsMap = std::unordered_map<Name, EffectAnalyzer>;
+
struct PassOptions {
// Run passes in debug mode, doing extra validation and timing checks.
bool debug = false;
@@ -166,6 +171,14 @@ struct PassOptions {
// passes.
std::map<std::string, std::string> arguments;
+ // Effect info computed for functions. One pass can generate this and then
+ // other passes later can benefit from it. It is up to the sequence of passes
+ // to update or discard this when necessary - in particular, when new effects
+ // are added to a function this must be changed or we may optimize
+ // incorrectly (however, it is extremely rare for a pass to *add* effects;
+ // passes normally only remove effects).
+ std::shared_ptr<FuncEffectsMap> funcEffectsMap;
+
// -Os is our default
static constexpr const int DEFAULT_OPTIMIZE_LEVEL = 2;
static constexpr const int DEFAULT_SHRINK_LEVEL = 1;