[llvm] [DebugInfo][RegisterCoalescer] Drop DBG_VALUEs with unsupported register class (PR #143132)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 6 06:30:51 PDT 2025
================
@@ -0,0 +1,149 @@
+# Check if DBG_VALUE is set to undef if it doesn't support an updated
+# register class.
+# Input was generated from compiler-rt/lib/builtins/adddf3.c.
+
+# RUN: llc -mtriple i386-apple-macosx10.7.0 -run-pass=register-coalescer %s -o - | FileCheck %s
+
+# CHECK-NOT: DBG_VALUE.*sub_8bit
+# CHECK: DBG_VALUE $noreg
+# CHECK-NOT: DBG_VALUE.*sub_8bit
+
+--- |
+ target datalayout = "e-m:o-p:32:32-p270:32:32-p271:32:32-p272:64:64-i128:128-f64:32:64-f80:128-n8:16:32-S128"
+ target triple = "i386-apple-macosx10.7.0"
+
+ define i32 @foo(i1 %i) {
+ entry:
+ %shl = or i32 0, 1
+ br i1 %i, label %if.then, label %if.end
+
+ if.then: ; preds = %entry
+ %cmp = icmp ne i32 %shl, 0
+ #dbg_value(i1 %cmp, !4, !DIExpression(DW_OP_LLVM_convert, 1, DW_ATE_unsigned, DW_OP_LLVM_convert, 8, DW_ATE_unsigned, DW_OP_stack_value), !12)
+ %conv127.i = zext i1 %cmp to i32
+ %or = or i32 %shl, %conv127.i
+ br label %if.end
+
+ if.end: ; preds = %if.then, %entry
+ %res = phi i32 [ %or, %if.then ], [ 1, %entry ]
+ ret i32 %res
+ }
----------------
arsenm wrote:
Shouldn't need much of anything in the IR section, except maybe some debug metadata. You might be able to get away with DBG_VALUE with missing debug entries
https://github.com/llvm/llvm-project/pull/143132
More information about the llvm-commits
mailing list