RFC: LoopEditor, a high-level loop transform toolkit

Hi Michael,

+llvmdev,Hal,Nadav

For testing, I was currently thinking of a two pronged approach. Lit tests as you suggest with a dummy pass, probably with command line options to define what transform to do, and unit tests to test the delegate behaviour and return values.

I’ll try and produce a mega patch with at least the loop vectoriser moved over, then split it up again after review.

Cheers,

James

I should mention that I don’t currently have such a patch - I’ll have to do a bunch of work to create it and start the test suite in the process.

I think refactoring the commonalities into a LoopEditor makes sense.

The LoopVectorizer has grown to be a class with a lot of functionality. Moving some of the parts shared with other loop optimization passes makes sense to me. As we want to tackle more and more loop nest optimizations I think this will become imperative to maintainability.

Most of the interesting state in the vectorizer will move to the delegate.