mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-11-23 20:20:06 +00:00
a1f9e1342e
The following passes are updated to preserve the inst-to-block and def-use analysies: private-to-local aggressive dead-code elimination dead branch elimination local-single-block elimination local-single-store elimination reduce load size compact ids (inst-to-block only) merge block dead-insert elimination ccp The one execption is that compact ids still kills the def-use manager. This is because it changes so many ids it is faster to kill and rebuild. Does everything in https://github.com/KhronosGroup/SPIRV-Tools/issues/1593 except for the changes to merge return.
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
// Copyright (c) 2017 Google Inc.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
|
|
#ifndef LIBSPIRV_OPT_COMPACT_IDS_PASS_H_
|
|
#define LIBSPIRV_OPT_COMPACT_IDS_PASS_H_
|
|
|
|
#include "ir_context.h"
|
|
#include "module.h"
|
|
#include "pass.h"
|
|
|
|
namespace spvtools {
|
|
namespace opt {
|
|
|
|
// See optimizer.hpp for documentation.
|
|
class CompactIdsPass : public Pass {
|
|
public:
|
|
const char* name() const override { return "compact-ids"; }
|
|
Status Process(ir::IRContext*) override;
|
|
|
|
// Return the mask of preserved Analyses.
|
|
ir::IRContext::Analysis GetPreservedAnalyses() override {
|
|
return ir::IRContext::kAnalysisInstrToBlockMapping |
|
|
ir::IRContext::kAnalysisCombinators | ir::IRContext::kAnalysisCFG |
|
|
ir::IRContext::kAnalysisDominatorAnalysis |
|
|
ir::IRContext::kAnalysisLoopAnalysis |
|
|
ir::IRContext::kAnalysisNameMap;
|
|
}
|
|
};
|
|
|
|
} // namespace opt
|
|
} // namespace spvtools
|
|
|
|
#endif // LIBSPIRV_OPT_COMPACT_IDS_PASS_H_
|