[LLVMdev] Speculative phi elimination at the top of a loop?

Pekka Nikander pekka.nikander at nomadiclab.com
Fri Jun 4 12:36:48 PDT 2010


Hi Devang,

On Fri, Jun 4, 2010 at 5:18 AM, Pekka Nikander <pekka.nikander at nomadiclab.com> wrote:
>>  Would the best way be to add an option to -loop-unroll, and hack away at lib/Transforms/Utils/LoopUnroll.cpp?

On 2010-06 -04, at 20:36 , Devang Patel wrote:
> Instead, the better alternative is to write another pass similar to
> LoopUnrollPass.cpp (say LoopPeelPass.cpp) and add new option
> -loop-peel. The new pass could use llvm::UnrollLoop() utility
> function. Feel free to adjust this utility function if required, but
> the core utility function should be used by both passes.

Thanks, we'll do that.  

BTW, I wanted to know why I didn't know the term, and found this:  Apparently loop peeling was included into GCC 3.4 around 2003-2004.  The previous time I did optimisation was in 1999-2000, and it was with GCC 2.95....  The GCC folks seem to cite the Cohn and Lowney paper [1] from 2000.  Hwu et al [2] is from 1993, but it doesn't use the term.  No wonder I didn't know this is called peeling. :-)

Hence, it looks like that my past experience is ancient by now.  I guess I need to dig out more recent papers referring to those, as well as seeing what Kennedy and Allen write in their book (which is cited at the Wikipedia page).  Any other good pieces of work to update my knowledge?


[1] Robert Cohn and P. Geoffrey Lowney, "Design and Analysis of Profile-Based Optimization in Compaq's Compilation Tools for Alpha", Journal of Instruction Level Parallelism, 2000.

[2] W. W. Hwu, S. A. Mahlke, W. Y. Chen, P. P. Chang, N. J. Warter, R. A. Bringmann, R. O. Ouellette, R. E. Hank, T. Kiyohara, G. E. Haab, J. G. Holm, and D. M. Lavery, “The Superblock: An Effective Technique for VLIW and Superscalar Compilation ,” The Journal of Supercomputing, Kluwer Aca- demic Publishers, 1993, pp. 229-248.

--Pekka





More information about the llvm-dev mailing list