[Beignet] [PATCH] GBE: don't always treat a multiple destination instruction as root.
Yang, Rong R
rong.r.yang at intel.com
Tue Dec 16 18:30:25 PST 2014
LGTM, thanks.
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Zhigang Gong
> Sent: Monday, December 15, 2014 11:58
> To: beignet at lists.freedesktop.org
> Cc: Gong, Zhigang
> Subject: [Beignet] [PATCH] 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 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
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list