#include "source/opt/aggressive_dead_code_elim_pass.h"
#include <memory>
#include <stack>
#include "source/cfa.h"
#include "source/opt/eliminate_dead_functions_util.h"
#include "source/opt/ir_builder.h"
#include "source/opt/reflect.h"
#include "source/spirv_constant.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kTypePointerStorageClassInIdx = …;
constexpr uint32_t kEntryPointFunctionIdInIdx = …;
constexpr uint32_t kSelectionMergeMergeBlockIdInIdx = …;
constexpr uint32_t kLoopMergeContinueBlockIdInIdx = …;
constexpr uint32_t kCopyMemoryTargetAddrInIdx = …;
constexpr uint32_t kCopyMemorySourceAddrInIdx = …;
constexpr uint32_t kLoadSourceAddrInIdx = …;
constexpr uint32_t kDebugDeclareOperandVariableIndex = …;
constexpr uint32_t kGlobalVariableVariableIndex = …;
struct DecorationLess { … };
}
bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId,
spv::StorageClass storageClass) { … }
bool AggressiveDCEPass::IsLocalVar(uint32_t varId, Function* func) { … }
void AggressiveDCEPass::AddStores(Function* func, uint32_t ptrId) { … }
bool AggressiveDCEPass::AllExtensionsSupported() const { … }
bool AggressiveDCEPass::IsTargetDead(Instruction* inst) { … }
void AggressiveDCEPass::ProcessLoad(Function* func, uint32_t varId) { … }
void AggressiveDCEPass::AddBranch(uint32_t labelId, BasicBlock* bp) { … }
void AggressiveDCEPass::AddBreaksAndContinuesToWorklist(
Instruction* mergeInst) { … }
bool AggressiveDCEPass::AggressiveDCE(Function* func) { … }
bool AggressiveDCEPass::KillDeadInstructions(
const Function* func, std::list<BasicBlock*>& structured_order) { … }
void AggressiveDCEPass::ProcessWorkList(Function* func) { … }
void AggressiveDCEPass::AddDebugScopeToWorkList(const Instruction* inst) { … }
void AggressiveDCEPass::AddDebugInstructionsToWorkList(
const Instruction* inst) { … }
void AggressiveDCEPass::AddDecorationsToWorkList(const Instruction* inst) { … }
void AggressiveDCEPass::MarkLoadedVariablesAsLive(Function* func,
Instruction* inst) { … }
std::vector<uint32_t> AggressiveDCEPass::GetLoadedVariables(Instruction* inst) { … }
uint32_t AggressiveDCEPass::GetLoadedVariableFromNonFunctionCalls(
Instruction* inst) { … }
std::vector<uint32_t> AggressiveDCEPass::GetLoadedVariablesFromFunctionCall(
const Instruction* inst) { … }
uint32_t AggressiveDCEPass::GetVariableId(uint32_t ptr_id) { … }
void AggressiveDCEPass::MarkBlockAsLive(Instruction* inst) { … }
void AggressiveDCEPass::MarkLoopConstructAsLiveIfLoopHeader(
BasicBlock* basic_block) { … }
void AggressiveDCEPass::AddOperandsToWorkList(const Instruction* inst) { … }
void AggressiveDCEPass::InitializeWorkList(
Function* func, std::list<BasicBlock*>& structured_order) { … }
void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() { … }
Pass::Status AggressiveDCEPass::ProcessImpl() { … }
bool AggressiveDCEPass::EliminateDeadFunctions() { … }
bool AggressiveDCEPass::ProcessGlobalValues() { … }
Pass::Status AggressiveDCEPass::Process() { … }
void AggressiveDCEPass::InitExtensions() { … }
Instruction* AggressiveDCEPass::GetHeaderBranch(BasicBlock* blk) { … }
BasicBlock* AggressiveDCEPass::GetHeaderBlock(BasicBlock* blk) const { … }
Instruction* AggressiveDCEPass::GetMergeInstruction(Instruction* inst) { … }
Instruction* AggressiveDCEPass::GetBranchForNextHeader(BasicBlock* blk) { … }
void AggressiveDCEPass::MarkFunctionParameterAsLive(const Function* func) { … }
bool AggressiveDCEPass::BlockIsInConstruct(BasicBlock* header_block,
BasicBlock* bb) { … }
bool AggressiveDCEPass::IsEntryPointWithNoCalls(Function* func) { … }
bool AggressiveDCEPass::IsEntryPoint(Function* func) { … }
bool AggressiveDCEPass::HasCall(Function* func) { … }
void AggressiveDCEPass::MarkFirstBlockAsLive(Function* func) { … }
void AggressiveDCEPass::AddUnreachable(BasicBlock*& block) { … }
}
}