#include "source/opt/local_single_store_elim_pass.h"
#include "source/cfa.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kStoreValIdInIdx = …;
constexpr uint32_t kVariableInitIdInIdx = …;
}
bool LocalSingleStoreElimPass::LocalSingleStoreElim(Function* func) { … }
bool LocalSingleStoreElimPass::AllExtensionsSupported() const { … }
Pass::Status LocalSingleStoreElimPass::ProcessImpl() { … }
LocalSingleStoreElimPass::LocalSingleStoreElimPass() = default;
Pass::Status LocalSingleStoreElimPass::Process() { … }
void LocalSingleStoreElimPass::InitExtensionAllowList() { … }
bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) { … }
bool LocalSingleStoreElimPass::RewriteDebugDeclares(Instruction* store_inst,
uint32_t var_id) { … }
Instruction* LocalSingleStoreElimPass::FindSingleStoreAndCheckUses(
Instruction* var_inst, const std::vector<Instruction*>& users) const { … }
void LocalSingleStoreElimPass::FindUses(
const Instruction* var_inst, std::vector<Instruction*>* users) const { … }
bool LocalSingleStoreElimPass::FeedsAStore(Instruction* inst) const { … }
bool LocalSingleStoreElimPass::RewriteLoads(
Instruction* store_inst, const std::vector<Instruction*>& uses,
bool* all_rewritten) { … }
}
}