[Beignet] [PATCH v2 1/2] fix the error that structure would be pushed twice

Yang, Rong R rong.r.yang at intel.com
Tue Nov 5 18:04:21 PST 2013


This patchset LGTM, thanks.

-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Lu Guanqun
Sent: Tuesday, November 05, 2013 1:55 PM
To: beignet at lists.freedesktop.org
Subject: [Beignet] [PATCH v2 1/2] fix the error that structure would be pushed twice

From: Yang Rong <rong.r.yang at intel.com>

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
Tested-by: Lu Guanqun <guanqun.lu at intel.com>
Reviewed-by: Lu Guanqun <guanqun.lu at intel.com>
---
 backend/src/ir/lowering.cpp |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/backend/src/ir/lowering.cpp b/backend/src/ir/lowering.cpp index 6cccaf5..013878c 100644
--- a/backend/src/ir/lowering.cpp
+++ b/backend/src/ir/lowering.cpp
@@ -233,8 +233,14 @@ namespace ir {
         const PushLocation argLocation(*fn, loadAddImm.argID, offset);
         if (inserted.contains(argLocation))
           continue;
+        Register pushed;
         const Register reg = load->getValue(valueID);
-        const Register pushed = fn->newRegister(family);
+        if (offset != 0) {
+            pushed = fn->newRegister(family);
+            this->appendPushedConstant(pushed, argLocation);
+        } else {
+            pushed = fn->getArg(loadAddImm.argID).reg;
+        }
 
         // TODO the MOV instruction can be most of the time avoided if the
         // register is never written. We must however support the register @@ -243,7 +249,6 @@ namespace ir {
         const Instruction mov = ir::MOV(type, reg, pushed);
         mov.replace(load);
         dead.insert(load);
-        this->appendPushedConstant(pushed, argLocation);
       }
     }
 

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


More information about the Beignet mailing list