[PATCH] D135808: [LoopInterchange] Correcting the profitability checking for vectorization

Bardia Mahjour via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 06:38:13 PDT 2022


bmahjour added a comment.

The proper profitability analysis for loop interchange uses `CacheCost`, although there are cases where it may be unable to analyze certain accesses (eg due to delinearization issues). It would be good to understand why we don't go through the CacheCost path in your use case.

The legacy heuristic doesn't look right to me, although your changes make the logic more aligned with the comments in the code.



================
Comment at: llvm/test/Transforms/LoopInterchange/pr43797-lcssa-for-multiple-outer-loop-blocks.ll:11
 
+; CHECK:      Name:            InterchangeNotProfitable
+; CHECK-NEXT: Function:        test1
----------------
I'm worried about losing functional coverage by avoiding interchange here due to profitability. Can you play with `-loop-interchange-threshold` or make slight changes to the memory accesses to make the test case profitable?


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

https://reviews.llvm.org/D135808



More information about the llvm-commits mailing list