Skip to content
Merged
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
8 changes: 8 additions & 0 deletions src/passes/OptimizeInstructions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct Pattern {
Pattern(Expression* input, Expression* output) : input(input), output(output) {}
};

#if 0
// Database of patterns
struct PatternDatabase {
Module wasm;
Expand Down Expand Up @@ -87,6 +88,7 @@ struct DatabaseEnsurer {
database = new PatternDatabase;
}
};
#endif

// Check for matches and apply them
struct Match {
Expand Down Expand Up @@ -169,7 +171,9 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions,
Pass* create() override { return new OptimizeInstructions; }

void prepareToRun(PassRunner* runner, Module* module) override {
#if 0
static DatabaseEnsurer ensurer;
#endif
}

void visitExpression(Expression* curr) {
Expand All @@ -181,6 +185,7 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions,
replaceCurrent(curr);
continue;
}
#if 0
auto iter = database->patternMap.find(curr->_id);
if (iter == database->patternMap.end()) return;
auto& patterns = iter->second;
Expand All @@ -195,6 +200,9 @@ struct OptimizeInstructions : public WalkerPass<PostWalker<OptimizeInstructions,
}
}
if (!more) break;
#else
break;
#endif
}
}

Expand Down