OSDN Git Service

intel/eu: Get rid of the return value of brw_send_indirect_message().
authorFrancisco Jerez <currojerez@riseup.net>
Sat, 2 Jun 2018 22:08:18 +0000 (15:08 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 10 Jul 2018 06:46:58 +0000 (23:46 -0700)
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().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/intel/compiler/brw_eu.h
src/intel/compiler/brw_eu_emit.c

index 884f1fb..3824ab2 100644 (file)
@@ -394,13 +394,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,
index 00e2554..2346d1a 100644 (file)
@@ -2418,7 +2418,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,
@@ -2428,20 +2428,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);
 
@@ -2455,10 +2447,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);
@@ -2473,8 +2464,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