[llvm] [RDF] Skip over NoRegister. NFCI. (PR #80672)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 5 04:26:50 PST 2024


https://github.com/jayfoad created https://github.com/llvm/llvm-project/pull/80672

This just avoids useless work of adding NoRegister to BaseSet, for
consistency with other places that iterate over all physical registers.


>From ff1ee5f3f53673ebe4cf403a0d83cdf5264250a1 Mon Sep 17 00:00:00 2001
From: Jay Foad <jay.foad at amd.com>
Date: Mon, 5 Feb 2024 12:10:30 +0000
Subject: [PATCH] [RDF] Skip over NoRegister. NFCI.

This just avoids useless work of adding NoRegister to BaseSet, for
consistency with other places that iterate over all physical registers.
---
 llvm/lib/CodeGen/RDFGraph.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/RDFGraph.cpp b/llvm/lib/CodeGen/RDFGraph.cpp
index 6b2e69da76f236..6276a4722e3f0d 100644
--- a/llvm/lib/CodeGen/RDFGraph.cpp
+++ b/llvm/lib/CodeGen/RDFGraph.cpp
@@ -870,7 +870,7 @@ void DataFlowGraph::build(const Config &config) {
     std::set<RegisterId> BaseSet;
     if (BuildCfg.Classes.empty()) {
       // Insert every register.
-      for (unsigned R = 0, E = getPRI().getTRI().getNumRegs(); R != E; ++R)
+      for (unsigned R = 1, E = getPRI().getTRI().getNumRegs(); R != E; ++R)
         BaseSet.insert(R);
     } else {
       for (const TargetRegisterClass *RC : BuildCfg.Classes) {



More information about the llvm-commits mailing list