gpu-compute: Fix bug with return in cfg
authorMichael LeBeane <michael.lebeane@amd.com>
Wed, 14 Sep 2016 03:11:20 +0000 (23:11 -0400)
committerMichael LeBeane <michael.lebeane@amd.com>
Wed, 14 Sep 2016 03:11:20 +0000 (23:11 -0400)
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

index 7e0e1091279809099dbee9d61fd00697950b3332..10ded11b7864c29ad01efbd220874cc7a4cdf066 100644 (file)
@@ -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();