[Bug tree-optimization/28364] poor optimization choices when iterating over a std::string (probably not c++-specific)

rakdver at atrey dot karlin dot mff dot cuni dot cz gcc-bugzilla@gcc.gnu.org
Wed Jul 12 23:39:00 GMT 2006



------- Comment #11 from rakdver at atrey dot karlin dot mff dot cuni dot cz  2006-07-12 23:39 -------
Subject: Re:  poor optimization choices when iterating over a std::string
(probably not c++-specific)

> I-cache.

this only matters if this increase in code size will make the code go
out of instruction cache.  It definitely is possible to artificially
construct programs where it matters, but I haven't seen one yet (ch
increases the total code size by less than 1% on all the te

> Also, more iterations before the branch predictors figure out what's
> going on.

But also possibly more consistent behavior with respect to branch
prediction, in case the loop is often exited in the first iteration.

In general, it is not possible to determine in ch whether loop header
copying will be profitable or not.  Undoing the loop header copying
by some later pass might be doable, although I am not quite sure how
much profitable.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28364



More information about the Gcc-bugs mailing list