summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2014-08-08 14:30:25 -0700
committerJason Ekstrand <[email protected]>2014-08-11 11:40:32 -0700
commitf5cc3fdcf1680b116612fac7c39f1bd79f5e555e (patch)
treeba2008c83a046d3e7e42a5c947a31664ed9db921
parent34ee3f5a343a9a9dde16994e35bb0b7ba8eab07a (diff)
i965/cse: Don't eliminate instructions with side-effects
This casues problems when converting atomics to use the GRF. Sometimes the atomic operation would get eaten by CSE when it shouldn't. v2: Roll the has_side_effects check into is_expression Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_cse.cpp2
-rw-r--r--src/mesa/drivers/dri/i965/brw_vec4_cse.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
index 01790ada8b4..033c09e0f85 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_cse.cpp
@@ -103,7 +103,7 @@ is_expression(const fs_inst *const inst)
case SHADER_OPCODE_LOAD_PAYLOAD:
return !is_copy_payload(inst);
default:
- return inst->is_send_from_grf();
+ return inst->is_send_from_grf() && !inst->has_side_effects();
}
}
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp
index 29d2e026205..1b8c9872d7f 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_cse.cpp
@@ -82,7 +82,7 @@ is_expression(const vec4_instruction *const inst)
case SHADER_OPCODE_COS:
return inst->mlen == 0;
default:
- return false;
+ return !inst->has_side_effects();
}
}