On 8/2/23 06:50, Richard Biener via Gcc-patches wrote:
On Mon, 31 Jul 2023, Richard Biener wrote:
statement_sink_location for loads is currently confused about
stores that are not on the paths we are sinking across. The
following avoids this by explicitely checking whether a block
with a store is on any of those paths. To not perform too many
walks over the sub-part of the CFG between the orignal stmt
location and the found sinking candidate we first collect all
blocks to check and then perform a single walk from the sinking
candidate location to the original stmt location. We avoid enlarging
the region by conservatively handling backedges.
The original heuristics what store locations to ignore have been
refactored, some can possibly be removed now.
If anybody knows a cheaper way to check whether a BB is on a path
from block A to block B which is dominated by A I'd be happy to
know (or if there would be a clever caching method at least - I'm
probably going to limit the number of blocks to walk to aovid
quadraticness).
I've replaced the whole thing with something based on virtual
operand liveness.
Good. I was trying to form something based on lowest common ancestor
walks in the dominator tree, but couldn't convince myself that it would
actually solve your problem.
jeff