[llvm-dev] Loop Strength Reduction Pass Does Not Work for Some Varialbles Related to Induction Variables

Tingyuan LIANG via llvm-dev llvm-dev at lists.llvm.org
Mon Apr 15 11:20:30 PDT 2019


Dear Momchil,

    Thanks a lot for your prompt reply and kindly suggestion.
    The code will truly lead to some automatic unrolling with GCC and increase the number of operations in the assembly code. However, I am focus on the the IR optimization and the calculation of the array element offest, which may need multiplication if the IR instruction GEP is lowered to arithmetic operations. The multiplication operations should be able to be removed by using the LLVM Pass LoopStrengthReduction. Interestingly, it does not work for the test code.
    I wamt to post the IR code but it might be too long to be in the mail.
    Thanks again for your time and precious suggestions!

Best regards,
------------------------------------------
Tingyuan LIANG
MPhil Student
Department of Electronic and Computer Engineering
The Hong Kong University of Science and Technology



发件人: Momchil Velikov
发送时间: 4月16日星期二 01:13
主题: Re: [llvm-dev] Loop Strength Reduction Pass Does Not Work for Some Varialbles Related to Induction Variables
收件人: Tingyuan LIANG
抄送: llvm-dev at lists.llvm.org


From a quick glance at the code, it looks like both inner loops were unrolled at least once (vary by architecture)
and have the expected number of multiplications, four and two (if unrolled once), respectively.

https://gcc.godbolt.org/z/1ks4Pt

--
Momchil Velikov,
Senior Compiler Engineer
Arm



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190415/1bc260bd/attachment.html>


More information about the llvm-dev mailing list