From a0de8a0a75f3640e10a27cb91822a11089f22b99 Mon Sep 17 00:00:00 2001 From: Mengchi Zhang Date: Tue, 9 May 2017 16:52:24 -0400 Subject: Fix next block addr to link predicate ret block to consecutive block The block containing predicate ret instruction should add the consecutive block to its successor_ids set. next_addr should be assigned with current instruction address add instruction size instead of 1. Signed-off-by: Mengchi Zhang --- src/cuda-sim/ptx_ir.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/cuda-sim') diff --git a/src/cuda-sim/ptx_ir.cc b/src/cuda-sim/ptx_ir.cc index 1805ce9..8ebdcf8 100644 --- a/src/cuda-sim/ptx_ir.cc +++ b/src/cuda-sim/ptx_ir.cc @@ -498,7 +498,7 @@ void function_info::connect_basic_blocks( ) //iterate across m_basic_blocks of f if( pI->has_pred() ) { printf("GPGPU-Sim PTX: Warning detected predicated return/exit.\n"); // if predicated, add link to next block - unsigned next_addr = pI->get_m_instr_mem_index() + 1; + unsigned next_addr = pI->get_m_instr_mem_index() + pI->inst_size(); if( next_addr < m_instr_mem_size && m_instr_mem[next_addr] ) { basic_block_t *next_bb = m_instr_mem[next_addr]->get_bb(); (*bb_itr)->successor_ids.insert(next_bb->bb_id); -- cgit v1.3