diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2021-09-11 17:33:25 +0200 |
---|---|---|
committer | Aldy Hernandez <aldyh@redhat.com> | 2021-09-13 16:34:48 +0200 |
commit | c7a669af0aeb639eb78f1614cbecb72a98d81ce8 (patch) | |
tree | a696301076a76ac2f3a927db342d94b700b0ff33 /gcc/tree-ssa-threadedge.c | |
parent | c8b2b89358481d36755dbc99e585a251780453b0 (diff) | |
download | gcc-c7a669af0aeb639eb78f1614cbecb72a98d81ce8.zip gcc-c7a669af0aeb639eb78f1614cbecb72a98d81ce8.tar.gz gcc-c7a669af0aeb639eb78f1614cbecb72a98d81ce8.tar.bz2 |
Remove references to FSM threads.
Now that the jump thread back registry has been split into the generic
copier and the custom (old) copier, it becomes trivial to remove the
FSM bits from the jump threaders.
First, there's no need for an EDGE_FSM_THREAD type. The only reason
we were looking at the threading type was to determine what type of
copier to use, and now that the copier has been split, there's no need
to even look. However, there is one check in register_jump_thread
where we verify that only the generic copier can thread through
back-edges. I've removed that check in favor of a flag passed to the
constructor.
I've also removed all the FSM references from the code and tests.
Interestingly, some tests weren't even testing the right thing. They
were testing for "FSM" which would catch jump thread paths as well as
the backward threader *failing* on registering a path. *big eye roll*
The only remaining code that was actually checking for EDGE_FSM_THREAD
was adjust_paths_after_duplication, and the checks could be written
without looking at the edge type at all. For the record, the code
there is horrible: it's convoluted, hard to read, and doesn't have any
tests. I'd smack myself if I could go back in time.
All that remains are the FSM references in the --param's themselves.
I think we should s/fsm/threader/, since I envision a day when we can
share the cost basis code between the threaders. However, I don't
know what the proper procedure is for renaming existing compiler
options.
By the way, param_fsm_maximum_phi_arguments is no longer relevant
after the rewrite. We can nuke that one right away.
Tested on x86-64 Linux.
gcc/ChangeLog:
* tree-ssa-threadbackward.c
(back_threader_profitability::profitable_path_p): Remove FSM
references.
(back_threader_registry::register_path): Same.
* tree-ssa-threadedge.c
(jump_threader::simplify_control_stmt_condition): Same.
* tree-ssa-threadupdate.c (jt_path_registry::jt_path_registry):
Add backedge_threads argument.
(fwd_jt_path_registry::fwd_jt_path_registry): Pass
backedge_threads argument.
(back_jt_path_registry::back_jt_path_registry): Same.
(dump_jump_thread_path): Adjust for FSM removal.
(back_jt_path_registry::rewire_first_differing_edge): Same.
(back_jt_path_registry::adjust_paths_after_duplication): Same.
(back_jt_path_registry::update_cfg): Same.
(jt_path_registry::register_jump_thread): Same.
* tree-ssa-threadupdate.h (enum jump_thread_edge_type): Remove
EDGE_FSM_THREAD.
(class back_jt_path_registry): Add backedge_threads to
constructor.
gcc/testsuite/ChangeLog:
* gcc.dg/tree-ssa/pr21417.c: Adjust for FSM removal.
* gcc.dg/tree-ssa/pr66752-3.c: Same.
* gcc.dg/tree-ssa/pr68198.c: Same.
* gcc.dg/tree-ssa/pr69196-1.c: Same.
* gcc.dg/tree-ssa/pr70232.c: Same.
* gcc.dg/tree-ssa/pr77445.c: Same.
* gcc.dg/tree-ssa/ranger-threader-4.c: Same.
* gcc.dg/tree-ssa/ssa-dom-thread-18.c: Same.
* gcc.dg/tree-ssa/ssa-dom-thread-6.c: Same.
* gcc.dg/tree-ssa/ssa-thread-12.c: Same.
* gcc.dg/tree-ssa/ssa-thread-13.c: Same.
Diffstat (limited to 'gcc/tree-ssa-threadedge.c')
-rw-r--r-- | gcc/tree-ssa-threadedge.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 422cb89..2b9a4c3 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -456,17 +456,17 @@ jump_threader::simplify_control_stmt_condition (edge e, gimple *stmt) = simplify_control_stmt_condition_1 (e, stmt, op0, cond_code, op1, recursion_limit); - /* If we were testing an integer/pointer against a constant, then - we can use the FSM code to trace the value of the SSA_NAME. If - a value is found, then the condition will collapse to a constant. + /* If we were testing an integer/pointer against a constant, + then we can trace the value of the SSA_NAME. If a value is + found, then the condition will collapse to a constant. Return the SSA_NAME we want to trace back rather than the full - expression and give the FSM threader a chance to find its value. */ + expression and give the threader a chance to find its value. */ if (cached_lhs == NULL) { /* Recover the original operands. They may have been simplified using context sensitive equivalences. Those context sensitive - equivalences may not be valid on paths found by the FSM optimizer. */ + equivalences may not be valid on paths. */ tree op0 = gimple_cond_lhs (stmt); tree op1 = gimple_cond_rhs (stmt); |