https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114855
--- Comment #27 from Andrew Macleod <amacleod at redhat dot com> --- (In reply to Aldy Hernandez from comment #26) > > With -O1 -fenable-tree-thread1 (no threadfull): > dominator optimization : 127.76 ( 7%) 0.57 ( 7%) 128.58 ( > 7%) 236M ( 9%) > backwards jump threading :1375.45 ( 79%) 1.81 ( 22%)1382.33 ( > 79%) 519M ( 20%) > TOTAL :1733.30 8.16 1747.35 > 2636M > > Richi mentioned that the handcuffs he added weren't being triggered in the > backwards threader because ranger was going outside the path, but > -fenable-tree-thread1 adds a light-weight threading pass that shouldn't use > anything but gori (*). So, either we're doing something stupid in path > discovery, or we're looking outside the path, even with a non-resolving > threader. Something definitely smells bad. > > (*) Well, technically we use the global ranger to look at relations. > Andrew, would looking at relations cause us to look outside of the given > path? Sure. If a relation is not resolved within the path, and there might be a relation determined before the path, then it queries the global oracle starting at the root of the path. The relation oracle does not cache anything on lookups. It was anticipated as a light weight query, and caching results would end up costing more in memory than it would save in subsequent queries. So if there are frequent queries that escape the path, and those potential relations are way up in the CFG, it could do a lot of traversals. Also, the oracle does not KNOW if there is a relation, it only knows when both ssa-names HAVE relations, so it has to go look to see if they are related to each other. That said, I tried disabling the root oracle, and there was basically no difference. So that is probably a red herring. I also tried disabling relations.. ie, hacked the path oracle to always return VREL_VARYING and not to actually register anything. the threader only dropped from 79% to 77% with no relations, so I do not think the relation oracle is the issue. Its sure pending a lot of time somewhere. still looking... It does appear to do a lot of the same work over and over.