[llvm] [X86][GlobalISel] Ignore non-vregs in regbank mapping (PR #182880)

Tommy Chiang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 09:07:42 PST 2026


================
@@ -0,0 +1,32 @@
+; RUN: llc -mtriple=x86_64-linux-gnu -global-isel -verify-machineinstrs < %s -o /dev/null
+
+; During x86 GlobalISel regbankselect, DBG_VALUE operands can reference
+; physical live-in registers (for example, $rdi). This must not crash.
+
+source_filename = "regbankselect-dbg-value-physreg-crash.c"
+target triple = "x86_64-unknown-linux-gnu"
+
+declare void @llvm.dbg.value(metadata, metadata, metadata)
+
+define void @foo(ptr %p) !dbg !8 {
+entry:
+  call void @llvm.dbg.value(metadata ptr %p, metadata !12, metadata !DIExpression()), !dbg !13
----------------
oToToT wrote:

I looked around and realized that this is made explicitly in https://github.com/llvm/llvm-project/commit/aaf6c7b05c9d155c8d34ec06a2f76ebdef8d21b9

It looks like we're trying to constraint DBG_VALUE operands through regbank/selection plumbing here?

And we have https://github.com/llvm/llvm-project/issues/57010 trying to make things more generic?

(Hope I understand these correctly)

https://github.com/llvm/llvm-project/pull/182880


More information about the llvm-commits mailing list