[llvm] [RegAlloc] Remove redundant prints of LiveInterval weight. (PR #116451)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 15 15:43:41 PST 2024


https://github.com/topperc created https://github.com/llvm/llvm-project/pull/116451

LiveInterval::print has included the weight since early 2018. We don't need to print again after we print the interval.

>From 6852406c94d823b52298ad6d629c1a0298104b36 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Fri, 15 Nov 2024 15:30:17 -0800
Subject: [PATCH] [RegAlloc] Remove redundant prints of LiveInterval weight.

LiveInterval::print has included the weight since early 2018. We
don't need to print again after we print the interval.
---
 llvm/lib/CodeGen/RegAllocBase.cpp            | 2 +-
 llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/CodeGen/RegAllocBase.cpp b/llvm/lib/CodeGen/RegAllocBase.cpp
index 60deb62bc908ad..449033d6321003 100644
--- a/llvm/lib/CodeGen/RegAllocBase.cpp
+++ b/llvm/lib/CodeGen/RegAllocBase.cpp
@@ -105,7 +105,7 @@ void RegAllocBase::allocatePhysRegs() {
     // result from splitting.
     LLVM_DEBUG(dbgs() << "\nselectOrSplit "
                       << TRI->getRegClassName(MRI->getRegClass(VirtReg->reg()))
-                      << ':' << *VirtReg << " w=" << VirtReg->weight() << '\n');
+                      << ':' << *VirtReg << '\n');
 
     using VirtRegVec = SmallVector<Register, 4>;
 
diff --git a/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp b/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
index a1dccc4d59723b..a1f441ebd0d5e4 100644
--- a/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
+++ b/llvm/lib/CodeGen/RegAllocEvictionAdvisor.cpp
@@ -157,7 +157,7 @@ bool DefaultEvictionAdvisor::shouldEvict(const LiveInterval &A, bool IsHint,
     return true;
 
   if (A.weight() > B.weight()) {
-    LLVM_DEBUG(dbgs() << "should evict: " << B << " w= " << B.weight() << '\n');
+    LLVM_DEBUG(dbgs() << "should evict: " << B << '\n');
     return true;
   }
   return false;



More information about the llvm-commits mailing list