Skip to content

Commit 2885e96

Browse files
committed
[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.
1 parent 8663b87 commit 2885e96

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,8 @@ void GISelKnownBits::computeKnownBitsImpl(Register R, KnownBits &Known,
148148
LLT DstTy = MRI.getType(R);
149149

150150
// Handle the case where this is called on a register that does not have a
151-
// type constraint (i.e. it has a register class constraint instead). This is
152-
// unlikely to occur except by looking through copies but it is possible for
153-
// the initial register being queried to be in this state.
151+
// type constraint. For example, it may be post-ISel or this target might not
152+
// preserve the type when early-selecting instructions.
154153
if (!DstTy.isValid()) {
155154
Known = KnownBits();
156155
return;

0 commit comments

Comments
 (0)