From: Karol Herbst <karolherbst@gmail.com>
To: mesa-dev@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Subject: [PATCH] nv50/ir: optimmize shl(a, 0) to a
Date: Sat, 29 Apr 2017 18:46:04 +0200 [thread overview]
Message-ID: <20170429164604.3263-1-karolherbst@gmail.com> (raw)
helps two alien isolation shaders
shader-db:
total instructions in shared programs : 4251497 -> 4251494 (-0.00%)
total gprs used in shared programs : 513962 -> 513962 (0.00%)
total local used in shared programs : 29797 -> 29797 (0.00%)
total bytes used in shared programs : 38960264 -> 38960232 (-0.00%)
local gpr inst bytes
helped 0 0 2 2
hurt 0 0 0 0
Signed-off-by: Karol Herbst <karolherbst@gmail.com>
---
src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index 015def0391..a2446e4df8 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -1284,6 +1284,11 @@ ConstantFolding::opnd(Instruction *i, ImmediateValue &imm0, int s)
case OP_SHL:
{
+ if (s == 1 && imm0.isInteger(0)) {
+ i->op = OP_MOV;
+ i->setSrc(1, NULL);
+ break;
+ }
if (s != 1 || i->src(0).mod != Modifier(0))
break;
// try to concatenate shifts
--
2.12.2
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
next reply other threads:[~2017-04-29 16:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-29 16:46 Karol Herbst [this message]
[not found] ` <20170429164604.3263-1-karolherbst-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-29 16:49 ` [PATCH] nv50/ir: optimmize shl(a, 0) to a Samuel Pitoiset
2017-04-29 19:03 ` Ilia Mirkin
2017-04-29 20:19 ` Karol Herbst
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170429164604.3263-1-karolherbst@gmail.com \
--to=karolherbst@gmail.com \
--cc=mesa-dev@lists.freedesktop.org \
--cc=nouveau@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.