diff --git a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java index a547ebf7b7..2c2585d232 100644 --- a/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java +++ b/tornado-drivers/opencl/src/main/java/uk/ac/manchester/tornado/drivers/opencl/graal/compiler/OCLBlockVisitor.java @@ -514,7 +514,7 @@ private void closeBranchBlock(HIRBlock block) { closeIfBlock(block, dom); } else if (isSwitchBlockNode(block)) { closeSwitchBlock(block, dom); - } else if (isNestedIfNode(block) && (!isStartNode(block))) { + } else if (isNestedIfNode(block) && (!isStartNode(block) && (!isMergeBlock(block)))) { closeBlock(block); } else if (isReturnBranchWithMerge(dom, block)) { closeBlock(block);