[clang] [llvm] [AMDGPU] First installment of IGLP_OPT 4 (MFMAValuSpacingOpt) implementation (PR #190916)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 29 18:57:51 PDT 2026
================
@@ -3095,8 +3112,19 @@ GCNPostScheduleDAGMILive::GCNPostScheduleDAGMILive(
: ScheduleDAGMI(C, std::move(S), RemoveKillFlags) {}
void GCNPostScheduleDAGMILive::schedule() {
- HasIGLPInstrs = hasIGLPInstrs(this);
- if (HasIGLPInstrs) {
+ auto [HasIGLP, Strategy] = hasIGLPInstrs(this);
+ HasIGLPInstrs = HasIGLP;
+ if (HasIGLP) {
+ // MFMAValuSpacingOpt is a pre-RA strategy whose interleaving is correct
+ // after the initial machine scheduler. The post-RA scheduler would undo
+ // the reordering, so preserve the pre-RA schedule by skipping here.
+ // When SCHED_[GROUP_]BARRIER coexists with IGLP_OPT, IGroupLP ignores the
+ // IGLP_OPT (they are mutually exclusive), so let post-RA scheduling proceed
+ // normally.
+ if (Strategy == AMDGPU::MFMAValuSpacingOptID && !hasSchedBarrier(this)) {
----------------
hidekisaito wrote:
> unless they already use the flag
I should also note that as soon as the second client wants to use the feature (Lucas Neves expressed interest on his mi450 development), "they already use the flag" assumption can break. It's best not to depend on the flag. If anything separate, "avoid post-RA" should be per-SR control.
https://github.com/llvm/llvm-project/pull/190916
More information about the cfe-commits
mailing list