Mesa (master): mesa: add missing size check for assignment optimization

Brian Paul brianp at kemper.freedesktop.org
Wed Nov 26 17:03:58 UTC 2008


Module: Mesa
Branch: master
Commit: aa40de5c6f7f70844d4a4c726456cceaee9f0e4d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=aa40de5c6f7f70844d4a4c726456cceaee9f0e4d

Author: Brian Paul <brian.paul at tungstengraphics.com>
Date:   Wed Nov 26 09:35:08 2008 -0700

mesa: add missing size check for assignment optimization

---

 src/mesa/shader/slang/slang_emit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c
index f31e9b4..e3cb252 100644
--- a/src/mesa/shader/slang/slang_emit.c
+++ b/src/mesa/shader/slang/slang_emit.c
@@ -1324,7 +1324,8 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n)
        _slang_is_temp(emitInfo->vt, n->Children[1]->Store) &&
        (inst->DstReg.File == n->Children[1]->Store->File) &&
        (inst->DstReg.Index == n->Children[1]->Store->Index) &&
-       !n->Children[0]->Store->IsIndirect) {
+       !n->Children[0]->Store->IsIndirect &&
+       n->Children[0]->Store->Size <= 4) {
       /* Peephole optimization:
        * The Right-Hand-Side has its results in a temporary place.
        * Modify the RHS (and the prev instruction) to store its results




More information about the mesa-commit mailing list