]> gcc.gnu.org Git - gcc.git/commit
Backwards threader greedy search TLC
authorRichard Biener <rguenther@suse.de>
Thu, 4 Aug 2022 07:21:24 +0000 (09:21 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 4 Aug 2022 13:01:38 +0000 (15:01 +0200)
commitd86d81a449c03641e079f23a2b3e1b2279a162fe
treecf1b9f0dfdb39bd8a84669ab365b80073fea6c95
parent07c7ee4d2d42f4728928556dbbe0700f9a13db90
Backwards threader greedy search TLC

I've tried to understand how the greedy search works seeing the
bitmap dances and the split into resolve_phi.  I've summarized
the intent of the algorithm as

      // For further greedy searching we want to remove interesting
      // names defined in BB but add ones on the PHI edges for the
      // respective edges.

but the implementation differs in detail.  In particular when
there is more than one interesting PHI in BB it seems to only consider
the first for translating defs across edges.  It also only applies
the loop crossing restriction when there is an interesting PHI.

The following preserves the loop crossing restriction to the case
of interesting PHIs but merges resolve_phi back, changing interesting
as outlined with the intent above.  It should get more threading
cases when there are multiple interesting PHI defs in a block.
It might be a bit faster due to less bitmap operations but in the
end the main intent was to make what happens more obvious.

* tree-ssa-threadbackward.cc (populate_worklist): Remove.
(back_threader::resolve_phi): Likewise.
(back_threader::find_paths_to_names): Rewrite greedy search.
gcc/tree-ssa-threadbackward.cc
This page took 0.061464 seconds and 5 git commands to generate.