[llvm] [MachinePipeliner] Improve loop carried dependence analysis (PR #94185)

Yuta Mukai via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 10 02:02:09 PST 2025


ytmukai wrote:

> Hello Yuta Mukai, could you please investigate why the 9 loops are not getting pipelined with your patch? Thank you.

Hello @iajbar, as a result of the correct detection of dependencies, the order of scheduling etc. may be changed and good schedules may not be found.

For example, the following loop cannot be pipelined with this patch.

https://github.com/llvm/llvm-test-suite/blob/e6f67406a1368ccff66e880af3297712be7a0fd9/MicroBenchmarks/ImageProcessing/Dither/orderedDitherKernel.c#L33-L36

For this loop unrolled, the current code determines that there are dependencies between accesseses of `outputImage`. However, as can be seen from the source code, there are in fact no dependencies. This patch fixes the problem, but the schedule will not be found as a result.
The swing modulo scheduling algorithm does not always find the optimal schedule, so changing the order of scheduling, etc. can sometimes lead to bad results. Therefore, it is not considered a substantial issue for this patch.

I will look into further cases.

https://github.com/llvm/llvm-project/pull/94185


More information about the llvm-commits mailing list