[Mesa-dev] [PATCH 15/23] intel/eu: Get rid of the return value of brw_send_indirect_message().

Francisco Jerez currojerez at riseup.net
Tue Jun 12 02:26:07 UTC 2018


The return value is not used anymore.  This allows simplifying the
code slightly, and in addition it should frustrate anybody's attempts
to continue using the obsolete piecemeal approach to construct a
message descriptor in combination with brw_send_indirect_message().
---
 src/intel/compiler/brw_eu.h      |  8 ++------
 src/intel/compiler/brw_eu_emit.c | 17 +++--------------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index 05536c3aaff..7ffd3c30665 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -378,13 +378,9 @@ void brw_urb_WRITE(struct brw_codegen *p,
 /**
  * Send message to shared unit \p sfid with a possibly indirect descriptor \p
  * desc.  If \p desc is not an immediate it will be transparently loaded to an
- * address register using an OR instruction.  The returned instruction can be
- * passed as argument to the usual brw_set_*_message() functions in order to
- * specify any additional descriptor bits -- If \p desc is an immediate this
- * will be the SEND instruction itself, otherwise it will be the OR
- * instruction.
+ * address register using an OR instruction.
  */
-struct brw_inst *
+void
 brw_send_indirect_message(struct brw_codegen *p,
                           unsigned sfid,
                           struct brw_reg dst,
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index e36cdadc70a..86c5c4bb3d2 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -2416,7 +2416,7 @@ void brw_urb_WRITE(struct brw_codegen *p,
 		       swizzle);
 }
 
-struct brw_inst *
+void
 brw_send_indirect_message(struct brw_codegen *p,
                           unsigned sfid,
                           struct brw_reg dst,
@@ -2426,20 +2426,12 @@ brw_send_indirect_message(struct brw_codegen *p,
 {
    const struct gen_device_info *devinfo = p->devinfo;
    struct brw_inst *send;
-   int setup;
 
    dst = retype(dst, BRW_REGISTER_TYPE_UW);
 
    assert(desc.type == BRW_REGISTER_TYPE_UD);
 
-   /* We hold on to the setup instruction (the SEND in the direct case, the OR
-    * in the indirect case) by its index in the instruction store.  The
-    * pointer returned by next_insn() may become invalid if emitting the SEND
-    * in the indirect case reallocs the store.
-    */
-
    if (desc.file == BRW_IMMEDIATE_VALUE) {
-      setup = p->nr_insn;
       send = next_insn(p, BRW_OPCODE_SEND);
       brw_set_desc(p, send, desc.ud | desc_imm);
 
@@ -2453,10 +2445,9 @@ brw_send_indirect_message(struct brw_codegen *p,
       brw_set_default_predicate_control(p, BRW_PREDICATE_NONE);
 
       /* Load the indirect descriptor to an address register using OR so the
-       * caller can specify additional descriptor bits with the usual
-       * brw_set_*_message() helper functions.
+       * caller can specify additional descriptor bits with the desc_imm
+       * immediate.
        */
-      setup = p->nr_insn;
       brw_OR(p, addr, desc, brw_imm_ud(desc_imm));
 
       brw_pop_insn_state(p);
@@ -2471,8 +2462,6 @@ brw_send_indirect_message(struct brw_codegen *p,
    brw_set_dest(p, send, dst);
    brw_set_src0(p, send, retype(payload, BRW_REGISTER_TYPE_UD));
    brw_inst_set_sfid(devinfo, send, sfid);
-
-   return &p->store[setup];
 }
 
 static void
-- 
2.16.1



More information about the mesa-dev mailing list