On 10/20/23 01:04, Robin Dapp wrote:
But I'm not sure which cases this code is trying to catch. Is it trying
to catch cases where seq2 "spontaneously" uses registers that happen to
overlap with cond? If so, then when does that happen? And if it does
happen, wouldn't the sequence also have to set the registers first?
In order for sequence costing to be superior to just counting "conditional"
instructions we need to make sure that as few redundant instructions as
possible are present in the costed sequences. (redundant as in "will be
removed in a subsequent pass").
[ ... ]
Sounds a lot like a scenario we had with threading. Threading will
often generate code in duplicated blocks that will trivially be eliminated.
IIRC I had Alex O. tackle that in threading several years back with good
success. I don't think he tried to be exhaustive, just sensible in what
was likely to be dead after threading. It helped numerous cases where
we clearly should have threaded, but weren't because of artificially
high costing.
It's not a trivial balancing act.
Jeff