-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 10/18/11 01:44, Paolo Bonzini wrote: > On 10/18/2011 07:10 AM, Jeff Law wrote: >> --- 467,475 ---- if (gimple_code (use) != GIMPLE_PHI) { sinkbb = >> gimple_bb (use); ! sinkbb = select_best_block (frombb, >> gimple_bb (use), stmt); >> >> ! if (sinkbb == frombb) return false; >> >> *togsi = gsi_for_stmt (use); > > Useless assignment of sinkbb, otherwise looks fine. Thanks. I'll fix that.
> > By the way, is it intended that sink_code_in_bb visits again > postdominators that were already visited (which with domwalk would > come for free)? As it is, the pass is quadratic when you have > something like this: I haven't really looked at the visitation order in tree-ssa-sink.c. The formulation as a walk over the pdom tree and sinking statements within each block is unfortunate, but workable. I'm not sure where you're seeing multiple visits of an individual block, but maybe I've got some kind of a mental block. The other way to formulate this problem is with recursion. A DFS walk to sink each statement's immediate uses, then sinking the statement itself. It's a nice, simple formulation that is annoyingly complex to implement in GCC due to "interesting" aspects of our immediate use iterators. Jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOnb/bAAoJEBRtltQi2kC7i7oIAIXnmR76SMZIBDQLHvMqEAME qTG5HkbL0kCb4EDMHYRXA4U8Wot1UWiuAkJzihBQMRWiqOs5v555iUx6N+M/l2Fu w+1SyqeZacNBLm9/bI/Ynbr55BXF3aKPxES5kqRWIJE1kCoOqKFOWAizgWJmyfMG ct13PpUqU1CT572cwl+GgCQulEWXQEgeOH/Iu/gLPFv+PSEhkEN0vA6foBYgCnk6 d4lGaa3NcQsUwhAlu4rNgQVAZL3cpTRL8QDIultxg3j/zEhcTwJ4YB4azDQcsRQ4 ZasKqD7m4HXnvuqS8TI66v+w4wKsparWyKTXAqp4dibnhON4l2Omes/ZmJokiUs= =HXaj -----END PGP SIGNATURE-----