Skip to content

Commit

Permalink
Update deps
Browse files Browse the repository at this point in the history
* Fix formatting
* Minor review change
* Fix test for header update
  • Loading branch information
alan-baker committed Jan 24, 2024
1 parent ca32ab1 commit b1e9e79
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vars = {
'protobuf_revision': 'v21.12',

're2_revision': '264e71e88e1c8a4b5ec326e70e9cf1d476f58a58',
'spirv_headers_revision': '7b0309708da5126b89e4ce6f19835f36dc912f2f',
'spirv_headers_revision': 'ae6a8b39717523d96683bc0d20b541944e28072f',
}

deps = {
Expand Down
2 changes: 1 addition & 1 deletion source/opt/modify_maximal_reconvergence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace opt {

Pass::Status ModifyMaximalReconvergence::Process() {
bool changed = false;
if (_add) {
if (add_) {
changed = AddMaximalReconvergence();
} else {
changed = RemoveMaximalReconvergence();
Expand Down
4 changes: 2 additions & 2 deletions source/opt/modify_maximal_reconvergence.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class ModifyMaximalReconvergence : public Pass {
const char* name() const override { return "modify-maximal-reconvergence"; }
Status Process() override;

explicit ModifyMaximalReconvergence(bool add = true) : Pass(), _add(add) {}
explicit ModifyMaximalReconvergence(bool add = true) : Pass(), add_(add) {}

IRContext::Analysis GetPreservedAnalyses() override {
return IRContext::kAnalysisDefUse |
Expand All @@ -45,7 +45,7 @@ class ModifyMaximalReconvergence : public Pass {
bool AddMaximalReconvergence();
bool RemoveMaximalReconvergence();

bool _add;
bool add_;
};
} // namespace opt
} // namespace spvtools
Expand Down
21 changes: 10 additions & 11 deletions source/val/validate_cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -878,12 +878,14 @@ spv_result_t StructuredControlFlowChecks(
}

spv_result_t MaximalReconvergenceChecks(ValidationState_t& _) {
// Find all the entry points with the MaximallReconvergencesKHR execution mode.
// Find all the entry points with the MaximallyReconvergencesKHR execution
// mode.
std::unordered_set<uint32_t> maximal_funcs;
std::unordered_set<uint32_t> maximal_entry_points;
for (auto entry_point : _.entry_points()) {
const auto* exec_modes = _.GetExecutionModes(entry_point);
if (exec_modes && exec_modes->count(spv::ExecutionMode::MaximallyReconvergesKHR)) {
if (exec_modes &&
exec_modes->count(spv::ExecutionMode::MaximallyReconvergesKHR)) {
maximal_entry_points.insert(entry_point);
maximal_funcs.insert(entry_point);
}
Expand Down Expand Up @@ -920,9 +922,8 @@ spv_result_t MaximalReconvergenceChecks(ValidationState_t& _) {
// Check for invalid multiple predecessors. Only loop headers, continue
// targets, merge targets or switch targets or defaults may have multiple
// unique predecessors.
for (const auto &func : _.functions()) {
if (!maximal_funcs.count(func.id()))
continue;
for (const auto& func : _.functions()) {
if (!maximal_funcs.count(func.id())) continue;

for (const auto* block : func.ordered_blocks()) {
std::unordered_set<uint32_t> unique_preds;
Expand All @@ -934,14 +935,12 @@ spv_result_t MaximalReconvergenceChecks(ValidationState_t& _) {
}
if (unique_preds.size() < 2) continue;


const auto *terminator = block->terminator();
const auto* terminator = block->terminator();
const auto index = terminator - &_.ordered_instructions()[0];
const auto *pre_terminator = &_.ordered_instructions()[index - 1];
if (pre_terminator->opcode() == spv::Op::OpLoopMerge)
continue;
const auto* pre_terminator = &_.ordered_instructions()[index - 1];
if (pre_terminator->opcode() == spv::Op::OpLoopMerge) continue;

const auto *label = _.FindDef(block->id());
const auto* label = _.FindDef(block->id());
bool ok = false;
for (const auto& pair : label->uses()) {
const auto* use_inst = pair.first;
Expand Down
2 changes: 1 addition & 1 deletion test/operand_capabilities_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ INSTANTIATE_TEST_SUITE_P(
CASE1(DECORATION, Decoration::XfbBuffer, TransformFeedback),
CASE1(DECORATION, Decoration::XfbStride, TransformFeedback),
CASE1(DECORATION, Decoration::FuncParamAttr, Kernel),
CASE1(DECORATION, Decoration::FPFastMathMode, Kernel),
CASE2(DECORATION, Decoration::FPFastMathMode, Kernel, FloatControls2),
CASE1(DECORATION, Decoration::LinkageAttributes, Linkage),
CASE1(DECORATION, Decoration::NoContraction, Shader),
CASE1(DECORATION, Decoration::InputAttachmentIndex,
Expand Down

0 comments on commit b1e9e79

Please sign in to comment.