compute_ranges_in_block loops over all the imports, and checks to see if each one is exported, then calculated an outgoing range for those that are. The outer loop loops over the import list, whereas the export list is usually smaller, and empty half the time.  This means we were doing a lot of busy work looping over the imports for no reason. The export list was extracted on each iteration of the loop, and because its a self sizing thing with a call, It doesn't get hauled out of the loop.  More extra work. This patch changes the loop to use EXECUTE_IF_AND_IN_BITMAP to only look at the intersection of imports and exports, ths only doing the work it needs to do. With a performance build, running with --param max-jump-thread-duplication-stmts=50 for good measure: before patch: backwards jump threading           :   5.91 ( 90%)   0.01 ( 20%)   5.93 ( 89%)    72  (  0%) TOTAL                           :   6.58          0.05 6.66           47M after patch: backwards jump threading           :   4.67 ( 88%)   0.01 ( 14%)   4.67 ( 86%)    72  (  0%) TOTAL                           :   5.31          0.07 5.42           47M bootstrapped on 86_64-pc-linux-gnu  with no regressions, and no change in the thread count.  pushed. Andrew