[PATCH] D81416: [LV] Interleave to expose ILP for small loops with scalar reductions.

Aaron H Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 08:20:47 PDT 2020


AaronLiu added a comment.

In D81416#2231013 <https://reviews.llvm.org/D81416#2231013>, @fhahn wrote:

> In D81416#2230857 <https://reviews.llvm.org/D81416#2230857>, @AaronLiu wrote:
>
>> In D81416#2230628 <https://reviews.llvm.org/D81416#2230628>, @fhahn wrote:
>>
>>> Just to double check, wouldn't it be sufficient if loop-unroll would unroll the loop? Or is this not happening? It seems like `loop-unroll` would unroll the loop in the test-case.
>>
>> It would unroll the loop in the testcase, but it will not break dependence and expose ILP, will not help performance, and actually unroll hurt performance in this case.
>
> I didn't took a very close look, but wouldnt unrolling generate similar code as interleaving, modulo different order of instructions,  but with similar compute instructions trees?
>
> Also, it seems like the loop already gets interleaved on current trunk (With IC=2) and this patch makes it more aggressive. Might be good to describe how the IC gets boosted by this option.

Correct, not like unroll, interleaving changes the order of reduction instructions and expose ILP.
Also you are right, the loop already gets interleaved on current trunk (With IC=2) and this patch makes it more aggressive but not that aggressive as explained in the code.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81416/new/

https://reviews.llvm.org/D81416



More information about the llvm-commits mailing list