[Beignet] [PATCH] GBE: don't always treat a multiple destination instruction as root.

Zhigang Gong zhigang.gong at intel.com
Sun Dec 14 19:58:03 PST 2014


Don't know why we set this type of instruction as root. It doesn't
make sense. For example, if we have a read_imagei() to read some
data to a int4 value and then never use these 4 value, we definitely
don't need to generate this instruction.

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

diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp
index 7ea2498..adff091 100644
--- a/backend/src/backend/gen_insn_selection.cpp
+++ b/backend/src/backend/gen_insn_selection.cpp
@@ -1464,14 +1464,13 @@ namespace gbe
   } selectionLibraryInitializer;
 
   bool Selection::Opaque::isRoot(const ir::Instruction &insn) const {
-    if (insn.getDstNum() > 1 ||
-        insn.hasSideEffect() ||
+    if (insn.hasSideEffect() ||
         insn.isMemberOf<ir::BranchInstruction>() ||
         insn.isMemberOf<ir::LabelInstruction>())
     return true;
 
     // No side effect, not a branch and no destination? Impossible
-    GBE_ASSERT(insn.getDstNum() == 1);
+    GBE_ASSERT(insn.getDstNum() >= 1);
 
     // Root if alive outside the block.
     // XXX we should use Value and not registers in liveness info
-- 
1.8.3.2



More information about the Beignet mailing list