[llvm] DAG: Avoid comparing Register to unsigned 0 (PR #155164)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 24 05:53:31 PDT 2025
https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/155164
None
>From 6a8d6a469f60e04f9b362457eb149d10b7372e10 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Sun, 24 Aug 2025 21:41:26 +0900
Subject: [PATCH] DAG: Avoid comparing Register to unsigned 0
---
llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index 1a63518ab37a6..861f76e93f2ce 100644
--- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -238,7 +238,7 @@ void InstrEmitter::CreateVirtualRegisters(SDNode *Node,
// Create the result registers for this node and add the result regs to
// the machine instruction.
- if (VRBase == 0) {
+ if (!VRBase) {
assert(RC && "Isn't a register operand!");
VRBase = MRI->createVirtualRegister(RC);
MIB.addReg(VRBase, RegState::Define);
More information about the llvm-commits
mailing list