Mesa (master): i965: Remove the RCP+RSQ algebraic optimizations
Jason Ekstrand
jekstrand at kemper.freedesktop.org
Tue Mar 22 23:41:49 UTC 2016
Module: Mesa
Branch: master
Commit: 01425c45b32fa7f323515b05697c6cc0d245ad32
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01425c45b32fa7f323515b05697c6cc0d245ad32
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Wed Mar 16 16:06:10 2016 -0700
i965: Remove the RCP+RSQ algebraic optimizations
NIR already has this optimization and it can do much better than the little
peephole in the backend.
No shader-db change on Haswell or Broadwell.
Reviewed-by: Matt Turner <mattst88 at gmail.com>
---
src/mesa/drivers/dri/i965/brw_fs.cpp | 11 -----------
src/mesa/drivers/dri/i965/brw_vec4.cpp | 11 -----------
2 files changed, 22 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index eaff953..1a6a229 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2274,17 +2274,6 @@ fs_visitor::opt_algebraic()
progress = true;
}
break;
- case SHADER_OPCODE_RCP: {
- fs_inst *prev = (fs_inst *)inst->prev;
- if (prev->opcode == SHADER_OPCODE_SQRT) {
- if (inst->src[0].equals(prev->dst)) {
- inst->opcode = SHADER_OPCODE_RSQ;
- inst->src[0] = prev->src[0];
- progress = true;
- }
- }
- break;
- }
case SHADER_OPCODE_BROADCAST:
if (is_uniform(inst->src[0])) {
inst->opcode = BRW_OPCODE_MOV;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index baf72a2..b9cf3f6 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -699,17 +699,6 @@ vec4_visitor::opt_algebraic()
break;
}
break;
- case SHADER_OPCODE_RCP: {
- vec4_instruction *prev = (vec4_instruction *)inst->prev;
- if (prev->opcode == SHADER_OPCODE_SQRT) {
- if (inst->src[0].equals(src_reg(prev->dst))) {
- inst->opcode = SHADER_OPCODE_RSQ;
- inst->src[0] = prev->src[0];
- progress = true;
- }
- }
- break;
- }
case SHADER_OPCODE_BROADCAST:
if (is_uniform(inst->src[0]) ||
inst->src[1].is_zero()) {
More information about the mesa-commit
mailing list