[PATCH] D96650: [NFC] Replace OuterLoopId with InnerLoopId - 1

Ta-Wei Tu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 13 16:57:36 PST 2021


TaWeiTu added a comment.

In D96650#2561834 <https://reviews.llvm.org/D96650#2561834>, @fhahn wrote:

>> The main reason for this refactor is to help passing ArrayRef to function processLoop() (remove the need to swap elements in loop list).
>
> Could you elaborate why this is needed to pass `ArrayRef`?  I think stylistically passing the outer-loop Id explicitly makes the functions a bit clearer and the functions currently are written in a way that does not rely on passing adjacent loops. If possible to keep the parameters, I think that would be preferable, rather than making the code less flexible. Otherwise there are various places where comments need updating.

Oh, I see. I think my wording is not accurate enough.
The place that makes passing `ArrayRef` possible is where `InnerLoop` and `OuterLoop` are explicitly passed to function `processLoop`, and I just find it a bit redundant to pass all `InnerLoop`, `OuterLoop`, `InnerLoopId` and `OuterLoopId` while replacing `LoopList`. But if the pass will potentially interchange non-adjacent loops in the future, keeping the parameters seems reasonable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96650



More information about the llvm-commits mailing list