[llvm-dev] Loop identification

Hal Finkel via llvm-dev llvm-dev at lists.llvm.org
Fri Jan 13 17:08:40 PST 2017


On 01/13/2017 12:53 PM, Krzysztof Parzyszek wrote:
> On 1/13/2017 10:52 AM, Hal Finkel wrote:
>> but I think we need to discuss the use case.
>
> The main case for us was recognizing polynomial multiplications. 
> Hexagon has instructions that do that, and the goal was to replace 
> loops that do that with intrinsics. The problem is that these loops 
> often get unrolled and intertwined with other code, making the 
> replacement hard, or impossible. This is especially true if some of 
> the multiplication code is combined with instructions that were not 
> originally part of it (I don't remember 100% if that was happening, 
> but the loop optimizations were the main culprit in making it hard).

This is integer multiplication or floating-point multiplication? If it 
is integer multiplication, I'd expect that using SCEV would be the 
easiest way to recognize the relevant patterns. SCEV is supposed to 
understand all of the unobfuscation tricks.

Do these instructions contain an implicit loop (of runtime trip count) 
or are you trying to match loops of some fixed trip count?

  -Hal

>
> -Krzysztof
>

-- 
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list