Mesa (master): nv50/ir: run DCE backwards

Ilia Mirkin imirkin at kemper.freedesktop.org
Thu Jan 28 20:40:06 UTC 2016


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

Author: Karol Herbst <nouveau at karolherbst.de>
Date:   Wed Jan 27 18:25:07 2016 +0100

nv50/ir: run DCE backwards

Reduces calls up to 50%

Signed-off-by: Karol Herbst <nouveau at karolherbst.de>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

---

 src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
index b2c9fdf..bda9c7d 100644
--- a/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
+++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_peephole.cpp
@@ -3187,10 +3187,10 @@ DeadCodeElim::buryAll(Program *prog)
 bool
 DeadCodeElim::visit(BasicBlock *bb)
 {
-   Instruction *next;
+   Instruction *prev;
 
-   for (Instruction *i = bb->getFirst(); i; i = next) {
-      next = i->next;
+   for (Instruction *i = bb->getExit(); i; i = prev) {
+      prev = i->prev;
       if (i->isDead()) {
          ++deadCount;
          delete_Instruction(prog, i);




More information about the mesa-commit mailing list