[Beignet] [PATCH] GBE: Optimize the forward jump instruction.

Zhigang Gong zhigang.gong at intel.com
Mon Mar 17 03:02:37 PDT 2014


As at each BB's begining, we already checked whether all channels are inactive,
we don't really need to do this duplicate checking at the end of forward jump.

This patch get about 25% performance gain for the luxmark's median scene.

Signed-off-by: Zhigang Gong <zhigang.gong at intel.com>
---
 backend/src/backend/gen_insn_selection.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 6dc561b..f277cb8 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -3167,12 +3167,15 @@ namespace gbe
 
         if (nextLabel == jip) return;
 
+        // As at each BB's begining, we already checked whether all channels are inactive,
+        // we don't really need to do this duplicate checking at the end of forward jump.
+        // Just comment out the following code, and may be deleted in the future.
+#if 0
         // It is slightly more complicated than for backward jump. We check that
         // all PcIPs are greater than the next block IP to be sure that we can
         // jump
         // We set all the inactive channel to 1 as the GEN_PREDICATE_ALIGN1_ALL8/16
         // will check those bits as well.
-
         sel.push();
           //sel.curr.physicalFlag = 0;
           sel.curr.flag = 1;
@@ -3199,6 +3202,7 @@ namespace gbe
 
           sel.JMPI(GenRegister::immd(0), jip);
         sel.pop();
+#endif
 
       } else {
         // Update the PcIPs
-- 
1.8.3.2



More information about the Beignet mailing list