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

Yang, Rong R rong.r.yang at intel.com
Wed Mar 19 00:58:33 PDT 2014


Good catch, LGTM.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Zhigang Gong
Sent: Monday, March 17, 2014 6:03 PM
To: beignet at lists.freedesktop.org
Cc: Gong, Zhigang
Subject: [Beignet] [PATCH] GBE: Optimize the forward jump instruction.

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

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list