summaryrefslogtreecommitdiff
path: root/source/opt
diff options
context:
space:
mode:
authorSteven Perron <stevenperron@google.com>2018-02-20 11:46:57 -0500
committerSteven Perron <31666470+s-perron@users.noreply.github.com>2018-02-20 14:45:08 -0500
commitec3bbf093e686964d464e3a7c70e691d98ed82c1 (patch)
tree6db230c58f8ca68f437c9d0d26f86af1eb56cc97 /source/opt
parent6c75050136a2657dac4501ca16d447852fc69e5f (diff)
downloadSPIRV-Tools-ec3bbf093e686964d464e3a7c70e691d98ed82c1.tar.gz
SPIRV-Tools-ec3bbf093e686964d464e3a7c70e691d98ed82c1.tar.bz2
SPIRV-Tools-ec3bbf093e686964d464e3a7c70e691d98ed82c1.zip
Preserve analysies in the simplification pass
Building the def-use chains is very expensive, so we do not want to invalidate them it if is not necessary. At the moment, it seems like most optimizatoins are good at not invalidating the def-use chains, but simplification does. This PR get the simlification pass to keep the analysies valid. Contributes to #1328.
Diffstat (limited to 'source/opt')
-rw-r--r--source/opt/simplification_pass.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/opt/simplification_pass.h b/source/opt/simplification_pass.h
index ff0e3be1..206d9dc8 100644
--- a/source/opt/simplification_pass.h
+++ b/source/opt/simplification_pass.h
@@ -27,6 +27,14 @@ class SimplificationPass : public Pass {
public:
const char* name() const override { return "simplify-instructions"; }
Status Process(ir::IRContext*) override;
+ virtual ir::IRContext::Analysis GetPreservedAnalyses() override {
+ return ir::IRContext::kAnalysisDefUse |
+ ir::IRContext::kAnalysisInstrToBlockMapping |
+ ir::IRContext::kAnalysisDecorations |
+ ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG |
+ ir::IRContext::kAnalysisDominatorAnalysis |
+ ir::IRContext::kAnalysisNameMap;
+ }
private:
// Returns true if the module was changed. The simplifier is called on every