From 6a668d0c0cc915ee2f1950e907cd61723d6b72c7 Mon Sep 17 00:00:00 2001 From: Michael LeBeane Date: Tue, 13 Sep 2016 23:11:20 -0400 Subject: [PATCH] gpu-compute: Fix bug with return in cfg Connecting basic blocks would stop too early in kernels where ret was not the last instruction. This patch allows basic blocks after the ret instruction to be properly connected. --- src/gpu-compute/kernel_cfg.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gpu-compute/kernel_cfg.cc b/src/gpu-compute/kernel_cfg.cc index 7e0e10912..10ded11b7 100644 --- a/src/gpu-compute/kernel_cfg.cc +++ b/src/gpu-compute/kernel_cfg.cc @@ -139,7 +139,7 @@ ControlFlowInfo::connectBasicBlocks() GPUStaticInst* last = lastInstruction(bb.get()); if (last->o_type == Enums::OT_RET) { bb->successorIds.insert(exit_bb->id); - break; + continue; } if (last->o_type == Enums::OT_BRANCH) { const uint32_t target_pc = last->getTargetPc(); -- 2.30.2