[llvm-dev] Lowering For Loops to use architecture "loop" instruction

Roel Jordans via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 3 03:48:36 PDT 2016


On 02/06/16 19:14, Joerg Sonnenberger via llvm-dev wrote:
> On Thu, Jun 02, 2016 at 03:18:08AM +0000, Dilan Manatunga via llvm-dev wrote:
>> I'm working on project which involves writing a backend for a hypothetical
>> architecture. I am currently trying to figure out the best way to translate
>> for loops to use a specialized "loop" instruction the architecture
>> supports. The instruction is similar X86's loop instruction, where a
>> register is automatically decremented and the condition is automatically
>> checked to see if loop execution should continue.
>>
>> I was wondering what is the best way to go about implementing this. I tried
>> looking to see how X86 implemented their loop instruction, but couldn't
>> really find where the IR instructions were being lowered to the loop
>> instruction.
>
> A better example might PowerPC's CTR loop pass.
>
> Joerg

Or Hexagon's hardware loops pass.

Roel

> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>


More information about the llvm-dev mailing list