]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR target/39284
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Jun 2014 21:52:31 +0000 (21:52 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Jun 2014 21:52:31 +0000 (21:52 +0000)
        * passes.def (peephole2): Move peephole2 pass before
        before sched2 pass.
        * config/i386/i386.md (peehole2): Combine memories
        and indirect jumps.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211919 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.md
gcc/passes.def

index df29febfa499a6352a9d4f8fb5d37eb222db196f..7d7bd2538a4f6ec8a4121251cecd3198c7e29e33 100644 (file)
@@ -1,3 +1,11 @@
+2014-06-23  Kai Tietz  <ktietz@redhat.com>
+
+       PR target/39284
+       * passes.def (peephole2): Move peephole2 pass before
+       before sched2 pass.
+       * config/i386/i386.md (peehole2): Combine memories
+       and indirect jumps.
+
 2014-06-23  Richard Biener  <rguenther@suse.de>
 
        * tree-ssa-loop.c (gate_loop): New function.
index 44c7a0ae9f01a6fab0e771998ff65043d3cfe294..695b981f2e1251a0dc692576a44d5372757fbc58 100644 (file)
                            (match_dup 4)))
              (unspec [(const_int 0)] UNSPEC_PEEPSIB)])])
 
+;; Combining simple memory jump instruction
+
+(define_peephole2
+  [(set (match_operand:W 0 "register_operand")
+        (match_operand:W 1 "memory_operand"))
+   (set (pc) (match_dup 0))]
+  "!TARGET_X32 && peep2_reg_dead_p (2, operands[0])"
+  [(set (pc) (match_dup 1))])
+
 ;; Call subroutine, returning value in operand 0
 
 (define_expand "call_value"
index c574b4ecff416a65d3a8c55f4f8fa00e3161cd1e..729be9cc90a8f68fb0ca5f59ac777715daa30f65 100644 (file)
@@ -394,13 +394,20 @@ along with GCC; see the file COPYING3.  If not see
          NEXT_PASS (pass_rtl_dse2);
          NEXT_PASS (pass_stack_adjustments);
          NEXT_PASS (pass_jump2);
-         NEXT_PASS (pass_peephole2);
          NEXT_PASS (pass_if_after_reload);
          NEXT_PASS (pass_regrename);
          NEXT_PASS (pass_cprop_hardreg);
          NEXT_PASS (pass_fast_rtl_dce);
          NEXT_PASS (pass_duplicate_computed_gotos);
          NEXT_PASS (pass_reorder_blocks);
+         /* We need to run peephole2 pass after the duplicate-
+            compute-gotos and the reorder-blocks pass (PR/39284).
+            We have a single indirect branch in the entire function
+            before duplicate-compute-gotos pass.  This vastly reduces
+            the size of the CFG.
+            For preventing to run peephole2 pass twice, its run after
+            the jump2 got removed.  */
+         NEXT_PASS (pass_peephole2);
          NEXT_PASS (pass_branch_target_load_optimize2);
          NEXT_PASS (pass_leaf_regs);
          NEXT_PASS (pass_split_before_sched2);