[PATCH] D128877: [LoopCacheAnalysis] Fix a type mismatch bug in cost calculation

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 19 12:59:51 PDT 2022


Meinersbur accepted this revision.
Meinersbur added a comment.
This revision is now accepted and ready to land.

In D128877#3660863 <https://reviews.llvm.org/D128877#3660863>, @congzhe wrote:

> Thanks Michael for your suggestion, I've updated the patch accordingly.
>
> I'm just wondering if you meant `A[trunc]=42` in your example? Also I'm a bit confused if the loop actually iterates over `A` twice? It looks to me the variable `i` loops from `0x0100` to `0x01FF`, hence `trunc` loops from `A[0x00]` to `A[0xFF]` so seems like it just iterates once?

Both you remarks are correct. You already fixed the first. I started with a loop `for (uint32_t i = 0; i < 512; ++i)` which would iterate twice over the array (once forward, once backward) but then found it overcomplicates things but forgot to change it everywhere. Could you fix it either way? After that, LGTM.


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

https://reviews.llvm.org/D128877



More information about the llvm-commits mailing list