Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llvm][CodeGen] Added missing initialization failure information for window scheduler #99449

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

kaiyan96
Copy link
Contributor

Added missing initialization failure information for window scheduler.

@llvmbot
Copy link
Collaborator

llvmbot commented Jul 18, 2024

@llvm/pr-subscribers-backend-hexagon

Author: Kai Yan (kaiyan96)

Changes

Added missing initialization failure information for window scheduler.


Full diff: https://github.com/llvm/llvm-project/pull/99449.diff

2 Files Affected:

  • (modified) llvm/lib/CodeGen/WindowScheduler.cpp (+4-1)
  • (modified) llvm/test/CodeGen/Hexagon/swp-ws-fail-2.mir (+1)
diff --git a/llvm/lib/CodeGen/WindowScheduler.cpp b/llvm/lib/CodeGen/WindowScheduler.cpp
index 0777480499e55..3fe8a1aaafd12 100644
--- a/llvm/lib/CodeGen/WindowScheduler.cpp
+++ b/llvm/lib/CodeGen/WindowScheduler.cpp
@@ -232,8 +232,11 @@ bool WindowScheduler::initialize() {
       return false;
     }
     for (auto &Def : MI.all_defs())
-      if (Def.isReg() && Def.getReg().isPhysical())
+      if (Def.isReg() && Def.getReg().isPhysical()) {
+        LLVM_DEBUG(dbgs() << "Physical registers are not supported in "
+                             "window scheduling!\n");
         return false;
+      }
   }
   if (SchedInstrNum <= WindowRegionLimit) {
     LLVM_DEBUG(dbgs() << "There are too few MIs in the window region!\n");
diff --git a/llvm/test/CodeGen/Hexagon/swp-ws-fail-2.mir b/llvm/test/CodeGen/Hexagon/swp-ws-fail-2.mir
index 601b98dca8e20..be75301b016ed 100644
--- a/llvm/test/CodeGen/Hexagon/swp-ws-fail-2.mir
+++ b/llvm/test/CodeGen/Hexagon/swp-ws-fail-2.mir
@@ -3,6 +3,7 @@
 # RUN: -window-sched=force -filetype=null -verify-machineinstrs 2>&1 \
 # RUN: | FileCheck %s
 
+# CHECK: Physical registers are not supported in window scheduling!
 # CHECK: The WindowScheduler failed to initialize!
 
 ---

@@ -232,8 +232,11 @@ bool WindowScheduler::initialize() {
return false;
}
for (auto &Def : MI.all_defs())
if (Def.isReg() && Def.getReg().isPhysical())
if (Def.isReg() && Def.getReg().isPhysical()) {
LLVM_DEBUG(dbgs() << "Physical registers are not supported in "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit noisy

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there is more debug information. Our consideration is that as a newly proposed software pipelining algorithm, the window algorithm may require more detailed output information to facilitate analysis and debugging.

@huaatian huaatian merged commit 2d6ff0c into llvm:main Jul 24, 2024
10 checks passed
yuxuanchen1997 pushed a commit that referenced this pull request Jul 25, 2024
…window scheduler (#99449)

Summary: Added missing initialization failure information for window scheduler.

Test Plan: 

Reviewers: 

Subscribers: 

Tasks: 

Tags: 


Differential Revision: https://phabricator.intern.facebook.com/D60250707
Harini0924 pushed a commit to Harini0924/llvm-project that referenced this pull request Aug 1, 2024
…window scheduler (llvm#99449)

Added missing initialization failure information for window scheduler.
kaiyan96 added a commit to kaiyan96/llvm-project that referenced this pull request Aug 12, 2024
…window scheduler (llvm#99449)

Added missing initialization failure information for window scheduler.
tru pushed a commit to kaiyan96/llvm-project that referenced this pull request Aug 20, 2024
…window scheduler (llvm#99449)

Added missing initialization failure information for window scheduler.
tru pushed a commit to kaiyan96/llvm-project that referenced this pull request Sep 1, 2024
…window scheduler (llvm#99449)

Added missing initialization failure information for window scheduler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:Hexagon mi-sched machine instruction scheduler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants