[llvm] [GlobalISel] Correct comment about type vs register class (PR #116083)

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 21 11:16:29 PST 2024


https://github.com/dsandersllvm updated https://github.com/llvm/llvm-project/pull/116083

>From 2885e96c0a17705beb57de22b7e64ed1da5c47da Mon Sep 17 00:00:00 2001
From: Daniel Sanders <daniel_l_sanders at apple.com>
Date: Wed, 13 Nov 2024 09:35:48 -0800
Subject: [PATCH] [GlobalISel] Correct comment about type vs register class

Type and register class aren't mutually exclusive in gMIR but there's also
no target-independent requirement (yet?) to have both on target instructions.
---
 llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
index 827da6a2ed8098..30cd3ce3baa502 100644
--- a/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
@@ -148,9 +148,8 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
   LLT DstTy = MRI.getType(R);
 
   // Handle the case where this is called on a register that does not have a
-  // type constraint (i.e. it has a register class constraint instead). This is
-  // unlikely to occur except by looking through copies but it is possible for
-  // the initial register being queried to be in this state.
+  // type constraint. For example, it may be post-ISel or this target might not
+  // preserve the type when early-selecting instructions.
   if (!DstTy.isValid()) {
     Known = KnownBits();
     return;



More information about the llvm-commits mailing list