Update spirv-tools to 025ea89 (#6393)
This commit is contained in:
+33
-16
@@ -33,7 +33,7 @@ namespace val {
|
||||
static const uint32_t kInvalidId = 0x400000;
|
||||
|
||||
Function::Function(uint32_t function_id, uint32_t result_type_id,
|
||||
SpvFunctionControlMask function_control,
|
||||
spv::FunctionControlMask function_control,
|
||||
uint32_t function_type_id)
|
||||
: id_(function_id),
|
||||
function_type_id_(function_type_id),
|
||||
@@ -73,6 +73,8 @@ spv_result_t Function::RegisterLoopMerge(uint32_t merge_id,
|
||||
BasicBlock& continue_target_block = blocks_.at(continue_id);
|
||||
assert(current_block_ &&
|
||||
"RegisterLoopMerge must be called when called within a block");
|
||||
current_block_->RegisterStructuralSuccessor(&merge_block);
|
||||
current_block_->RegisterStructuralSuccessor(&continue_target_block);
|
||||
|
||||
current_block_->set_type(kBlockTypeLoop);
|
||||
merge_block.set_type(kBlockTypeMerge);
|
||||
@@ -101,6 +103,7 @@ spv_result_t Function::RegisterSelectionMerge(uint32_t merge_id) {
|
||||
current_block_->set_type(kBlockTypeSelection);
|
||||
merge_block.set_type(kBlockTypeMerge);
|
||||
merge_block_header_[&merge_block] = current_block_;
|
||||
current_block_->RegisterStructuralSuccessor(&merge_block);
|
||||
|
||||
AddConstruct({ConstructType::kSelection, current_block(), &merge_block});
|
||||
|
||||
@@ -251,16 +254,6 @@ Function::GetBlocksFunction Function::AugmentedCFGSuccessorsFunction() const {
|
||||
};
|
||||
}
|
||||
|
||||
Function::GetBlocksFunction
|
||||
Function::AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const {
|
||||
return [this](const BasicBlock* block) {
|
||||
auto where = loop_header_successors_plus_continue_target_map_.find(block);
|
||||
return where == loop_header_successors_plus_continue_target_map_.end()
|
||||
? AugmentedCFGSuccessorsFunction()(block)
|
||||
: &(*where).second;
|
||||
};
|
||||
}
|
||||
|
||||
Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const {
|
||||
return [this](const BasicBlock* block) {
|
||||
auto where = augmented_predecessors_map_.find(block);
|
||||
@@ -269,11 +262,35 @@ Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const {
|
||||
};
|
||||
}
|
||||
|
||||
Function::GetBlocksFunction Function::AugmentedStructuralCFGSuccessorsFunction()
|
||||
const {
|
||||
return [this](const BasicBlock* block) {
|
||||
auto where = augmented_successors_map_.find(block);
|
||||
return where == augmented_successors_map_.end()
|
||||
? block->structural_successors()
|
||||
: &(*where).second;
|
||||
};
|
||||
}
|
||||
|
||||
Function::GetBlocksFunction
|
||||
Function::AugmentedStructuralCFGPredecessorsFunction() const {
|
||||
return [this](const BasicBlock* block) {
|
||||
auto where = augmented_predecessors_map_.find(block);
|
||||
return where == augmented_predecessors_map_.end()
|
||||
? block->structural_predecessors()
|
||||
: &(*where).second;
|
||||
};
|
||||
}
|
||||
|
||||
void Function::ComputeAugmentedCFG() {
|
||||
// Compute the successors of the pseudo-entry block, and
|
||||
// the predecessors of the pseudo exit block.
|
||||
auto succ_func = [](const BasicBlock* b) { return b->successors(); };
|
||||
auto pred_func = [](const BasicBlock* b) { return b->predecessors(); };
|
||||
auto succ_func = [](const BasicBlock* b) {
|
||||
return b->structural_successors();
|
||||
};
|
||||
auto pred_func = [](const BasicBlock* b) {
|
||||
return b->structural_predecessors();
|
||||
};
|
||||
CFA<BasicBlock>::ComputeAugmentedCFG(
|
||||
ordered_blocks_, &pseudo_entry_block_, &pseudo_exit_block_,
|
||||
&augmented_successors_map_, &augmented_predecessors_map_, succ_func,
|
||||
@@ -354,10 +371,10 @@ int Function::GetBlockDepth(BasicBlock* bb) {
|
||||
return block_depth_[bb];
|
||||
}
|
||||
|
||||
void Function::RegisterExecutionModelLimitation(SpvExecutionModel model,
|
||||
void Function::RegisterExecutionModelLimitation(spv::ExecutionModel model,
|
||||
const std::string& message) {
|
||||
execution_model_limitations_.push_back(
|
||||
[model, message](SpvExecutionModel in_model, std::string* out_message) {
|
||||
[model, message](spv::ExecutionModel in_model, std::string* out_message) {
|
||||
if (model != in_model) {
|
||||
if (out_message) {
|
||||
*out_message = message;
|
||||
@@ -368,7 +385,7 @@ void Function::RegisterExecutionModelLimitation(SpvExecutionModel model,
|
||||
});
|
||||
}
|
||||
|
||||
bool Function::IsCompatibleWithExecutionModel(SpvExecutionModel model,
|
||||
bool Function::IsCompatibleWithExecutionModel(spv::ExecutionModel model,
|
||||
std::string* reason) const {
|
||||
bool return_value = true;
|
||||
std::stringstream ss_reason;
|
||||
|
||||
Reference in New Issue
Block a user