]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: tilegx.c (tilegx_gen_bundles): Delete barrier insns before bundling.
authorWalter Lee <walt@tilera.com>
Sat, 25 Jan 2014 22:44:41 +0000 (22:44 +0000)
committerWalter Lee <walt@gcc.gnu.org>
Sat, 25 Jan 2014 22:44:41 +0000 (22:44 +0000)
2014-01-25  Walter Lee  <walt@tilera.com>

            Backport from mainline
            2014-01-25  Walter Lee  <walt@tilera.com>

            * config/tilegx/tilegx.c (tilegx_gen_bundles): Delete barrier
            insns before bundling.
            * config/tilegx/tilegx.md (tile_network_barrier): Update
            comment.

From-SVN: r207102

gcc/ChangeLog
gcc/config/tilegx/tilegx.c
gcc/config/tilegx/tilegx.md

index 651068ff871ff32aadd2035bed8bd090a11290a6..81ce918e6008ef34502bd608fecad812c8a34fb9 100644 (file)
@@ -1,3 +1,13 @@
+2014-01-25  Walter Lee  <walt@tilera.com>
+
+       Backport from mainline
+       2014-01-25  Walter Lee  <walt@tilera.com>
+
+       * config/tilegx/tilegx.c (tilegx_gen_bundles): Delete barrier
+       insns before bundling.
+       * config/tilegx/tilegx.md (tile_network_barrier): Update
+       comment.
+
 2014-01-25  Walter Lee  <walt@tilera.com>
 
        Backport from mainline
index e7ab94881f09d18e84ab0f6c948768083c0c294d..be0027d1bb21e0d8cbb1b76895393a9dce97237f 100644 (file)
@@ -4333,10 +4333,12 @@ tilegx_gen_bundles (void)
   basic_block bb;
   FOR_EACH_BB (bb)
     {
-      rtx insn, next;
+      rtx insn, next, prev;
       rtx end = NEXT_INSN (BB_END (bb));
 
-      for (insn = next_insn_to_bundle (BB_HEAD (bb), end); insn; insn = next)
+      prev = NULL_RTX;
+      for (insn = next_insn_to_bundle (BB_HEAD (bb), end); insn;
+          prev = insn, insn = next)
        {
          next = next_insn_to_bundle (NEXT_INSN (insn), end);
 
@@ -4361,6 +4363,18 @@ tilegx_gen_bundles (void)
                  PUT_MODE (insn, SImode);
                }
            }
+
+         /* Delete barrier insns, because they can mess up the
+            emitting of bundle braces.  If it is end-of-bundle, then
+            the previous insn must be marked end-of-bundle.  */
+         if (get_attr_type (insn) == TYPE_NOTHING) {
+           if (GET_MODE (insn) == QImode && prev != NULL
+               && GET_MODE (prev) == SImode)
+             {
+               PUT_MODE (prev, QImode);
+             }
+           delete_insn (insn);
+         }
        }
     }
 }
index 5a16fecb3b1c562de9624b3fbdc8737304ddbffb..dd4581152045051aa1df6a642ed5f75b2262eecd 100644 (file)
 \f
 ;; Network intrinsics
 
-;; Note the "pseudo" text is handled specially by the
-;; asm_output_opcode routine.  If the output is an empty string, the
-;; instruction would bypass the asm_output_opcode routine, bypassing
-;; the bundle handling code.
+;; Note the this barrier is of type "nothing," which is deleted after
+;; the final scheduling pass so that nothing is emitted for it.
 (define_insn "tilegx_network_barrier"
   [(unspec_volatile:SI [(const_int 0)] UNSPEC_NETWORK_BARRIER)]
   ""