[llvm] r261538 - [WebAssembly] Properly ignore llvm.dbg.value instructions.

Dan Gohman via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 22 09:45:21 PST 2016


Author: djg
Date: Mon Feb 22 11:45:20 2016
New Revision: 261538

URL: http://llvm.org/viewvc/llvm-project?rev=261538&view=rev
Log:
[WebAssembly] Properly ignore llvm.dbg.value instructions.

Modified:
    llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
    llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll

Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp?rev=261538&r1=261537&r2=261538&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp Mon Feb 22 11:45:20 2016
@@ -423,7 +423,11 @@ bool WebAssemblyRegStackify::runOnMachin
       // Don't nest anything inside an inline asm, because we don't have
       // constraints for $push inputs.
       if (Insert->getOpcode() == TargetOpcode::INLINEASM)
-        break;
+        continue;
+
+      // Ignore debugging intrinsics.
+      if (Insert->getOpcode() == TargetOpcode::DBG_VALUE)
+        continue;
 
       // Iterate through the inputs in reverse order, since we'll be pulling
       // operands off the stack in LIFO order.

Modified: llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll?rev=261538&r1=261537&r2=261538&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll Mon Feb 22 11:45:20 2016
@@ -347,4 +347,22 @@ define i32 @store_past_invar_load(i32 %a
   ret i32 %b
 }
 
+; CHECK-LABEL: ignore_dbg_value:
+; CHECK-NEXT: unreachable
+declare void @llvm.dbg.value(metadata, i64, metadata, metadata)
+define void @ignore_dbg_value() {
+  call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !1, metadata !7), !dbg !8
+  unreachable
+}
+
+!llvm.module.flags = !{!9}
+
 !0 = !{}
+!1 = !DILocalVariable(name: "nzcnt", scope: !2, file: !3, line: 15, type: !6)
+!2 = distinct !DISubprogram(name: "test", scope: !3, file: !3, line: 10, type: !4, isLocal: false, isDefinition: true, scopeLine: 11, flags: DIFlagPrototyped, isOptimized: true, variables: !0)
+!3 = !DIFile(filename: "test.c", directory: "/")
+!4 = !DISubroutineType(types: !0)
+!6 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
+!7 = !DIExpression()
+!8 = !DILocation(line: 15, column: 6, scope: !2)
+!9 = !{i32 2, !"Debug Info Version", i32 3}




More information about the llvm-commits mailing list