summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMengchi Zhang <[email protected]>2017-05-09 16:52:24 -0400
committerMengchi Zhang <[email protected]>2017-05-09 16:52:24 -0400
commita0de8a0a75f3640e10a27cb91822a11089f22b99 (patch)
tree843c4853ef7b4f37c845faa1a76ef5dbab03c7f6 /src
parent0b18b586e78ff474e0b1db58c4f605b2b13b3727 (diff)
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 <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/cuda-sim/ptx_ir.cc2
1 files changed, 1 insertions, 1 deletions
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);