4 Commits

Author SHA1 Message Date
Hua Tian
811e505c5b
[llvm][CodeGen] Update checking method of loop-carried phi in window scheduler (#96288)
Added some logic to check loop-carried phis in the window scheduler. It now includes the scenario where the preceding phi uses the virtual register defined by the succeeding phi.
2024-06-26 09:56:09 +08:00
Hua Tian
dd1d2b7cb0
[llvm][CodeGen] Fix failure in window scheduler caused by phi (#95900)
In certain cases, the register passed with the kernel MBB in phi are not
defined within the kernel MBB. This patch adds the corresponding handling.
2024-06-19 15:15:37 +08:00
Hua Tian
355e4a9e56
[llvm][CodeGen] Fix failure in window scheduler caused by weak dependencies (#95636)
This commit addresses an issue where weak dependencies trigger an
assertion in the window scheduler under certain conditions.
2024-06-16 03:48:00 +08:00
Hua Tian
b6bf4024a0
[llvm][CodeGen] Add a new software pipeliner 'Window Scheduler' (#84443)
This commit implements the Window Scheduler as described in the RFC:

https://discourse.llvm.org/t/rfc-window-scheduling-algorithm-for-machinepipeliner-in-llvm/74718

This Window Scheduler implements the window algorithm designed by
Steven Muchnick in the book "Advanced Compiler Design And
Implementation",
with some improvements:

1. Copy 3 times of the loop kernel and construct the corresponding DAG
   to identify dependencies between MIs;
2. Use heuristic algorithm to obtain a set of window offsets.

The window algorithm is equivalent to modulo scheduling algorithm with a
stage of 2. It is mainly applied in targets where hardware resource
conflicts are severe, and the SMS algorithm often fails in such cases.
On our own DSA, this window algorithm typically can achieve a
performance
improvement of over 10%.

Co-authored-by: Kai Yan <aklkaiyan@tencent.com>
Co-authored-by: Ran Xiao <lennyxiao@tencent.com>

---------

Co-authored-by: Kai Yan <aklkaiyan@tencent.com>
Co-authored-by: Ran Xiao <lennyxiao@tencent.com>
2024-06-13 17:51:09 +08:00