[cfe-dev] Loop invariant and strength reduction

John McCall rjmccall at apple.com
Thu Feb 24 15:57:41 PST 2011

On Feb 24, 2011, at 3:49 PM, Damien Vincent wrote:
> OK, I wanted to simplify the example and it turns out that the backend optimizer is able to generate code without any multiplication.
> But what if the backend cannot derive an IR without multiplication ? What was a simple code at the beginning might become more complicated...
> I will simplify my example (but not that much) and post it on the mailing list.

There are people who can speak to this better than I can, but my understanding is that the optimizers only do this transformation for loops that fit the narrow definition of canonical form that they expect the target-independent optimizer to be able to lower efficiently.  By all means, though, if you can find a counter-example, that's something we want to know about.


More information about the cfe-dev mailing list