summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAhmad Alawneh <[email protected]>2025-04-21 07:24:34 -0400
committerGitHub <[email protected]>2025-04-21 11:24:34 +0000
commit1c6cd9b95abb211ef0288d4d1aa1c6163d74428c (patch)
tree7410c97d1fb8de8658f75f0f3916a64e74af7ff7
parent8124cbbcd154a54bda86360e2a566d48940a0caa (diff)
fix a bug , we inc number of inst without checking if inst is null (#114)
-rw-r--r--src/gpgpu-sim/shader.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 7482e0e..1ea011e 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -891,9 +891,9 @@ void shader_core_ctx::decode() {
// decode 1 or 2 instructions and place them into ibuffer
address_type pc = m_inst_fetch_buffer.m_pc;
const warp_inst_t *pI1 = get_next_inst(m_inst_fetch_buffer.m_warp_id, pc);
- m_warp[m_inst_fetch_buffer.m_warp_id]->ibuffer_fill(0, pI1);
- m_warp[m_inst_fetch_buffer.m_warp_id]->inc_inst_in_pipeline();
- if (pI1) {
+ if (pI1) {
+ m_warp[m_inst_fetch_buffer.m_warp_id]->ibuffer_fill(0, pI1);
+ m_warp[m_inst_fetch_buffer.m_warp_id]->inc_inst_in_pipeline();
m_stats->m_num_decoded_insn[m_sid]++;
if ((pI1->oprnd_type == INT_OP) ||
(pI1->oprnd_type == UN_OP)) { // these counters get added up in mcPat