diff options
author | Ilya Leoshkevich <iii@linux.ibm.com> | 2018-12-03 09:49:02 +0000 |
---|---|---|
committer | Ilya Leoshkevich <iii@gcc.gnu.org> | 2018-12-03 09:49:02 +0000 |
commit | 98fe146e5be55232c20ef242ee7c7e2123373df4 (patch) | |
tree | 2a93928458a1a7d8f995e86940931e86e729de63 /gcc/cfgcleanup.c | |
parent | e45130c59e988c6825b14b9f10f41fb2e256c2e5 (diff) |
Repeat jump threading after combine
Consider the following RTL:
(insn (set (reg 65) (if_then_else (eq %cc 0) 1 0)))
(insn (parallel [(set %cc (compare (reg 65) 0)) (clobber %scratch)]))
(jump_insn (set %pc (if_then_else (ne %cc 0) (label_ref 23) %pc)))
Combine simplifies this into:
(note NOTE_INSN_DELETED)
(note NOTE_INSN_DELETED)
(jump_insn (set %pc (if_then_else (eq %cc 0) (label_ref 23) %pc)))
opening up the possibility to perform jump threading.
gcc/ChangeLog:
2018-12-03 Ilya Leoshkevich <iii@linux.ibm.com>
PR target/80080
* cfgcleanup.c (class pass_postreload_jump): New pass.
(pass_postreload_jump::execute): Likewise.
(make_pass_postreload_jump): Likewise.
* passes.def: Add pass_postreload_jump before
pass_postreload_cse.
* tree-pass.h (make_pass_postreload_jump): New pass.
gcc/testsuite/ChangeLog:
2018-12-03 Ilya Leoshkevich <iii@linux.ibm.com>
PR target/80080
* gcc.target/s390/pr80080-4.c: New test.
From-SVN: r266734
Diffstat (limited to 'gcc/cfgcleanup.c')
-rw-r--r-- | gcc/cfgcleanup.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 4a5dc29d14f..bc4a78889db 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -3259,6 +3259,48 @@ make_pass_jump (gcc::context *ctxt) namespace { +const pass_data pass_data_postreload_jump = +{ + RTL_PASS, /* type */ + "postreload_jump", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + TV_JUMP, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0, /* todo_flags_finish */ +}; + +class pass_postreload_jump : public rtl_opt_pass +{ +public: + pass_postreload_jump (gcc::context *ctxt) + : rtl_opt_pass (pass_data_postreload_jump, ctxt) + {} + + /* opt_pass methods: */ + virtual unsigned int execute (function *); + +}; // class pass_postreload_jump + +unsigned int +pass_postreload_jump::execute (function *) +{ + cleanup_cfg (flag_thread_jumps ? CLEANUP_THREADING : 0); + return 0; +} + +} // anon namespace + +rtl_opt_pass * +make_pass_postreload_jump (gcc::context *ctxt) +{ + return new pass_postreload_jump (ctxt); +} + +namespace { + const pass_data pass_data_jump2 = { RTL_PASS, /* type */ |