Also note that whether or not it is profitable to unroll a particular loop depends largely on how "hot" that loop is, and GCC doesn't know much about that if you don't feed it profiling information (it can guess a bit, sure, but it can guess wrong too).actually, what you are saying is that the compiler can't know enough to figure out how to optimize for speed. it will just do what you tell it to, either unroll loops or not.
It bases its optimisation decisions on the options you give it, the profile feedback information you either or not gave it, and a whole bunch of heuristics.
this argues that both O2 and Os are incorrect for a project to use and instead the project needs to make it's own decisions on this.
For optimal performance, you need to fine-tune options yes, per file (or per function even!)
if this is the true feeling of the gcc team I'm very disappointed, it feels like a huge step backwards.
I speak only for myself. However this is the only way it _can_ be, the compiler isn't clairvoyant. Some of the heuristics sure could use some tuning, but they stay heuristics. Segher - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- References:
- [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Denis Cheng <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Oleg Verych <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: "rae l" <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Oleg Verych <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Benjamin LaHaise <[email protected]>
- Re: [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- From: Arjan van de Ven <[email protected]>
- -Os versus -O2
- From: Adrian Bunk <[email protected]>
- Re: -Os versus -O2
- From: Arjan van de Ven <[email protected]>
- Re: -Os versus -O2
- From: [email protected]
- Re: -Os versus -O2
- From: Segher Boessenkool <[email protected]>
- Re: -Os versus -O2
- From: [email protected]
- [PATCH] trivial: the memset operation on a automatic array variable should be optimized out by data initialization
- Prev by Date: Problems with mounting flash partition with jffs2
- Next by Date: Re: -Os versus -O2
- Previous by thread: Re: -Os versus -O2
- Next by thread: Re: -Os versus -O2
- Index(es):