diff options
author | Zhigang Gong <zhigang.gong@intel.com> | 2014-12-15 11:58:03 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-12-17 10:45:43 +0800 |
commit | 92866a083d19343bfa47463523484286d5143def (patch) | |
tree | 7c9eb8c16b4f443d2c94d2ec7b90895039b2f3e0 | |
parent | c69d495964304130152fe97c931e27f4516cf688 (diff) |
GBE: don't always treat a multiple destination instruction as root.
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@intel.com>
Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com>
-rw-r--r-- | backend/src/backend/gen_insn_selection.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/backend/src/backend/gen_insn_selection.cpp b/backend/src/backend/gen_insn_selection.cpp index 7ea24989..adff0914 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 |