#include "source/opt/invocation_interlock_placement_pass.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <optional>
#include <queue>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include "source/enum_set.h"
#include "source/enum_string_mapping.h"
#include "source/opt/ir_context.h"
#include "source/opt/reflect.h"
#include "source/spirv_target_env.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
namespace {
constexpr uint32_t kEntryPointExecutionModelInIdx = …;
constexpr uint32_t kEntryPointFunctionIdInIdx = …;
constexpr uint32_t kFunctionCallFunctionIdInIdx = …;
}
bool InvocationInterlockPlacementPass::hasSingleNextBlock(uint32_t block_id,
bool reverse_cfg) { … }
void InvocationInterlockPlacementPass::forEachNext(
uint32_t block_id, bool reverse_cfg, std::function<void(uint32_t)> f) { … }
void InvocationInterlockPlacementPass::addInstructionAtBlockBoundary(
BasicBlock* block, spv::Op opcode, bool at_end) { … }
bool InvocationInterlockPlacementPass::killDuplicateBegin(BasicBlock* block) { … }
bool InvocationInterlockPlacementPass::killDuplicateEnd(BasicBlock* block) { … }
void InvocationInterlockPlacementPass::recordBeginOrEndInFunction(
Function* func) { … }
bool InvocationInterlockPlacementPass::
removeBeginAndEndInstructionsFromFunction(Function* func) { … }
bool InvocationInterlockPlacementPass::extractInstructionsFromCalls(
std::vector<BasicBlock*> blocks) { … }
void InvocationInterlockPlacementPass::recordExistingBeginAndEndBlock(
std::vector<BasicBlock*> blocks) { … }
InvocationInterlockPlacementPass::BlockSet
InvocationInterlockPlacementPass::computeReachableBlocks(
BlockSet& previous_inside, const BlockSet& starting_nodes,
bool reverse_cfg) { … }
bool InvocationInterlockPlacementPass::removeUnneededInstructions(
BasicBlock* block) { … }
BasicBlock* InvocationInterlockPlacementPass::splitEdge(BasicBlock* block,
uint32_t succ_id) { … }
bool InvocationInterlockPlacementPass::placeInstructionsForEdge(
BasicBlock* block, uint32_t next_id, BlockSet& inside,
BlockSet& previous_inside, spv::Op opcode, bool reverse_cfg) { … }
bool InvocationInterlockPlacementPass::placeInstructions(BasicBlock* block) { … }
bool InvocationInterlockPlacementPass::processFragmentShaderEntry(
Function* entry_func) { … }
bool InvocationInterlockPlacementPass::isFragmentShaderInterlockEnabled() { … }
Pass::Status InvocationInterlockPlacementPass::Process() { … }
}
}