aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorKai Yan <aklkaiyan@tencent.com>2024-07-24 12:11:58 +0800
committerGitHub <noreply@github.com>2024-07-24 12:11:58 +0800
commitcd1a2ede2f6a741adf34fc5b57eb73aa149b515c (patch)
treea7b828727ffcbac8320f2347878ee499d2d71b00 /llvm/lib/CodeGen
parent6810c05ccaeea318bc06076680a9a843b02a1881 (diff)
downloadllvm-cd1a2ede2f6a741adf34fc5b57eb73aa149b515c.zip
llvm-cd1a2ede2f6a741adf34fc5b57eb73aa149b515c.tar.gz
llvm-cd1a2ede2f6a741adf34fc5b57eb73aa149b515c.tar.bz2
[llvm][CodeGen] Added a new restriction for II by pragma in window scheduler (#99448)
Added a new restriction for window scheduling. Window scheduling is disabled when llvm.loop.pipeline.initiationinterval is set.
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/MachinePipeliner.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachinePipeliner.cpp b/llvm/lib/CodeGen/MachinePipeliner.cpp
index 497e282..5c68711 100644
--- a/llvm/lib/CodeGen/MachinePipeliner.cpp
+++ b/llvm/lib/CodeGen/MachinePipeliner.cpp
@@ -528,8 +528,16 @@ bool MachinePipeliner::useSwingModuloScheduler() {
}
bool MachinePipeliner::useWindowScheduler(bool Changed) {
- // WindowScheduler does not work when it is off or when SwingModuloScheduler
- // is successfully scheduled.
+ // WindowScheduler does not work for following cases:
+ // 1. when it is off.
+ // 2. when SwingModuloScheduler is successfully scheduled.
+ // 3. when pragma II is enabled.
+ if (II_setByPragma) {
+ LLVM_DEBUG(dbgs() << "Window scheduling is disabled when "
+ "llvm.loop.pipeline.initiationinterval is set.\n");
+ return false;
+ }
+
return WindowSchedulingOption == WindowSchedulingFlag::WS_Force ||
(WindowSchedulingOption == WindowSchedulingFlag::WS_On && !Changed);
}