15 Commits

Author SHA1 Message Date
Kazu Hirata
20d35fe5a5
[llvm] Use llvm::is_contained (NFC) (#135566) 2025-04-13 16:35:29 -07:00
Kazu Hirata
e3a3f78f35
[CodeGen] Use llvm::append_range (NFC) (#133603) 2025-03-29 16:53:02 -07:00
chrisPyr
71f4c7dabe
[NFC]Make file-local cl::opt global variables static (#126486)
#125983
2025-03-03 13:46:33 +07:00
Christudasan Devadasan
a47c35a699
[CodeGen] Move MISched target hooks into TargetMachine (#125700)
The createSIMachineScheduler & createPostMachineScheduler
target hooks are currently placed in the PassConfig interface.
Moving it out to TargetMachine so that both legacy and
the new pass manager can effectively use them.
2025-02-05 11:41:37 +05:30
Kazu Hirata
7a0c6cfdf3
[CodeGen] Avoid repeated hash lookups (NFC) (#125160) 2025-01-31 07:51:06 -08:00
Kai Yan
d808f15828
[llvm][CodeGen] Address the issue of multiple resource reservations In window scheduling (#101665)
Address the issue of multiple resource reservations in window
scheduling.
2024-08-05 17:44:05 +08:00
Kai Yan
58964c8499
Revert "[llvm][CodeGen] Address the issue of multiple resource reservations in window scheduling (#100301)" (#101658)
This reverts commit aa0a33be56f1ef8195eccbca57a103a8e1e302e3.
2024-08-02 20:27:22 +08:00
Kai Yan
aa0a33be56
[llvm][CodeGen] Address the issue of multiple resource reservations in window scheduling (#100301)
Address the issue of multiple resource reservations in window scheduling
2024-08-02 19:25:34 +08:00
Kai Yan
90a9979882
[llvm][CodeGen] Fixed a bug in stall cycle calculation for window scheduler (#99451)
Fixed a bug in stall cycle calculation.
When a register defined by an instruction in the current iteration is
used by an instruction in the next iteration, we have modified the
number of stall cycle that need to be inserted.
2024-07-25 19:16:23 +08:00
Kai Yan
2d6ff0c533
[llvm][CodeGen] Added missing initialization failure information for window scheduler (#99449)
Added missing initialization failure information for window scheduler.
2024-07-24 12:06:35 +08:00
Kai Yan
d27ee36cde
[llvm][CodeGen] Fixed max cycle calculation with zero-cost instructions for window scheduler (#99454)
We discovered some scheduling failures occurring when zero-cost
instructions were involved. This issue will be addressed by this patch.
2024-07-24 12:06:10 +08:00
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