Invalid iterator in control_flow_simplification_pass

This commit is contained in:
Nukem 2016-06-18 16:34:46 -04:00 committed by GitHub
parent 096febb3bb
commit d5dd96d626
1 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ bool ControlFlowSimplificationPass::Run(spv::Module* module) {
// Walk through the blocks in the function and merge any blocks which are
// unconditionally dominated.
for (auto it = function->getBlocks().end() - 1;
it != function->getBlocks().begin() - 1;) {
it != function->getBlocks().begin();) {
auto block = *it;
if (!block->isUnreachable() && block->getPredecessors().size() == 1) {
auto prev_block = block->getPredecessors()[0];
@ -45,4 +45,4 @@ bool ControlFlowSimplificationPass::Run(spv::Module* module) {
} // namespace spirv
} // namespace gpu
} // namespace xe
} // namespace xe