mesa: add missing size check for assignment optimization
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 26 Nov 2008 16:35:08 +0000 (09:35 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 6 Jan 2009 16:03:06 +0000 (09:03 -0700)
(cherry picked from commit aa40de5c6f7f70844d4a4c726456cceaee9f0e4d)

src/mesa/shader/slang/slang_emit.c

index 9266070844ae0aedff953298f4221783f512bb4e..7b45195b60bd4f3c7775d13eeae0c996f76fb9ea 100644 (file)
@@ -1321,7 +1321,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