[PATCH] D123400: [LoopCacheAnalysis] Consider dimension depth of the subscript reference when calculating cost

Congzhe Cao via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 19:32:29 PDT 2022


congzhe added a comment.

In D123400#3460157 <https://reviews.llvm.org/D123400#3460157>, @bmahjour wrote:

> The current loop cache analysis outputs the loops in the correct order by luck (because it maintains the original breath-first order and that order just happens to be the optimal order), but it outputs the same cost value for the two outer loops, which is the root problem! By ensuring that the correct and distinguishable cost is associated with each loop we also ensure that the optimal order is maintained. I do see your point in wanting to make sure that the sort order is correct, but if that's the case we probably want to use `CHECK-NEXT` instead of `CHECK-DAG` for your test.

Sure, I will update the test case in D122776 <https://reviews.llvm.org/D122776> to use `CHECK-NEXT` instead of `CHECK-DAG`, and update the cost numbers therein according to your improvement in this patch. Thanks again for all the discussions!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123400



More information about the llvm-commits mailing list