gpu-compute, hsail: call discardFetch() from the WF
authorTony Gutierrez <anthony.gutierrez@amd.com>
Thu, 27 Oct 2016 02:47:27 +0000 (22:47 -0400)
committerTony Gutierrez <anthony.gutierrez@amd.com>
Thu, 27 Oct 2016 02:47:27 +0000 (22:47 -0400)
because every taken branch causes fetch to be discarded, we move the call
to the WF to avoid to have to call it from each and every branch instruction
type.

src/arch/hsail/insts/branch.hh
src/gpu-compute/wavefront.cc

index 89bcc1277f35e00e047a79badac5f4ad86c43913..3a520b216f7205332be5130b9855375b5f89a23b 100644 (file)
@@ -133,7 +133,6 @@ namespace HsailISA
             // Rpc and execution mask remain the same
             w->pc(getTargetPc());
         }
-        w->discardFetch();
     }
 
     class BrnDirectInst : public BrnInstBase<LabelOperand>
@@ -293,7 +292,6 @@ namespace HsailISA
             w->pushToReconvergenceStack(true_pc, rpc, true_mask);
         }
         assert(w->pc() != curr_pc);
-        w->discardFetch();
     }
 
 
@@ -405,7 +403,6 @@ namespace HsailISA
             // Rpc and execution mask remain the same
             w->pc(getTargetPc());
         }
-        w->discardFetch();
     }
 
     class BrDirectInst : public BrInstBase<LabelOperand>
index caeed85a7d71716f7258a77b93dc4b2d9657519e..96f0d0e963d36931b88716423ab2ee2c4511e067 100644 (file)
@@ -675,6 +675,8 @@ Wavefront::exec()
         } else {
             instructionBuffer.pop_front();
         }
+    } else {
+        discardFetch();
     }
 
     if (computeUnit->shader->hsail_mode==Shader::SIMT) {