[Mesa-dev] [PATCH 59/59] intel/compiler: allow propagating HF immediates to MAD/LRP
Iago Toral Quiroga
itoral at igalia.com
Tue Dec 4 07:17:23 UTC 2018
---
src/intel/compiler/brw_fs_copy_propagation.cpp | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/src/intel/compiler/brw_fs_copy_propagation.cpp b/src/intel/compiler/brw_fs_copy_propagation.cpp
index 0f0284115fb..3d0fe883324 100644
--- a/src/intel/compiler/brw_fs_copy_propagation.cpp
+++ b/src/intel/compiler/brw_fs_copy_propagation.cpp
@@ -762,16 +762,15 @@ fs_visitor::try_constant_propagate(fs_inst *inst, acp_entry *entry)
case BRW_OPCODE_MAD:
case BRW_OPCODE_LRP:
- /* 3-src instructions can't take IMM registers, however, for 32-bit
- * floating instructions we rely on the combine constants pass to fix
- * it up. For anything else, we shouldn't be promoting immediates
- * until we can make the pass capable of combining constants of
- * different sizes.
+ /* 3-src instructions can't take IMM registers, but we allow this
+ * here in the hope that it can activate algebraic optimizations and
+ * then we rely on the combine constants pass to fix up the remaining
+ * cases.
*/
- if (val.type == BRW_REGISTER_TYPE_F) {
- inst->src[i] = val;
- progress = true;
- }
+ assert(val.type == BRW_REGISTER_TYPE_F ||
+ val.type == BRW_REGISTER_TYPE_HF);
+ inst->src[i] = val;
+ progress = true;
break;
default:
--
2.17.1
More information about the mesa-dev
mailing list