[llvm] r321207 - Improve the test for r320216. NFC.

Warren Ristow via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 20 11:11:31 PST 2017


Author: wristow
Date: Wed Dec 20 11:11:31 2017
New Revision: 321207

URL: http://llvm.org/viewvc/llvm-project?rev=321207&view=rev
Log:
Improve the test for r320216.  NFC.

Patch by Matthew Voss!

Modified:
    llvm/trunk/test/CodeGen/X86/machinesink-merge-debuginfo.ll
    llvm/trunk/test/CodeGen/X86/machinesink-null-debuginfo.ll

Modified: llvm/trunk/test/CodeGen/X86/machinesink-merge-debuginfo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/machinesink-merge-debuginfo.ll?rev=321207&r1=321206&r2=321207&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/machinesink-merge-debuginfo.ll (original)
+++ llvm/trunk/test/CodeGen/X86/machinesink-merge-debuginfo.ll Wed Dec 20 11:11:31 2017
@@ -5,6 +5,21 @@ source_filename = "test-sink-debug.cpp"
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 target triple = "x86_64-unknown-linux-gnu"
 
+; double foo(double x, double y, bool c) {
+;   double a = x / 3.0;
+;   double b = y / 5.0;
+;   double ret;
+;
+;   if (c)
+;      ret = a + 1.0;
+;   else
+;      ret = b + 1.0;
+;
+;   ret = ret + 1.0;
+;
+;   return ret;
+; }
+
 ; Function Attrs: nounwind readnone uwtable
 define double @_Z3fooddb(double %x, double %y, i1 zeroext %c) local_unnamed_addr !dbg !7 {
   tail call void @llvm.dbg.value(metadata double %x, metadata !13, metadata !DIExpression()), !dbg !16
@@ -17,9 +32,10 @@ first:
   %e = fadd double %a, 1.000000e+00
   br label %final
 second:
-  %f = fadd double %b, 1.000000e+00, !dbg !17
-; CHECK:  debug-location !17
-; CHECK:  debug-location !17
+; CHECK-NOT:  debug-location !17
+; CHECK:  debug-location !18
+; CHECK-NOT:  debug-location !17
+  %f = fadd double %b, 1.000000e+00, !dbg !18
   br label %final
 final:
   %cond = phi double [%e, %first], [%f, %second]
@@ -27,15 +43,39 @@ final:
   ret double %d
 }
 
-; Function Attrs: nounwind readnone speculatable
-declare void @llvm.dbg.value(metadata, metadata, metadata) #1
 
-attributes #1 = { nounwind readnone speculatable }
+
+; Function Attrs: nounwind readnone uwtable
+define double @_Z4foo1ddb(double %x, double %y, i1 zeroext %c) local_unnamed_addr !dbg !19 {
+  tail call void @llvm.dbg.value(metadata double %x, metadata !21, metadata !DIExpression()), !dbg !24
+  tail call void @llvm.dbg.value(metadata double %y, metadata !22, metadata !DIExpression()), !dbg !24
+  tail call void @llvm.dbg.value(metadata i1 %c, metadata !23, metadata !DIExpression()), !dbg !24
+  %a = fdiv double %x, 3.000000e+00
+  %b = fdiv double %y, 5.000000e+00, !dbg !25
+  br i1 %c, label %first, label %second
+first:
+  %e = fadd double %a, 1.000000e+00
+  br label %final
+second:
+  %f = fadd double %b, 1.000000e+00, !dbg !25
+; CHECK:  debug-location !25
+; CHECK-NEXT:  debug-location !25
+  br label %final
+final:
+  %cond = phi double [%e, %first], [%f, %second]
+  %d = fadd double %cond, 1.000000e+00
+  ret double %d
+}
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5}
 !llvm.ident = !{!6}
 
+attributes #1 = { nounwind readnone speculatable }
+
+; Function Attrs: nounwind readnone speculatable
+declare void @llvm.dbg.value(metadata, metadata, metadata) #1
+
 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 6.0.0 (trunk 313291)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
 !1 = !DIFile(filename: "test-sink-debug.cpp", directory: "/tmp")
 !2 = !{}
@@ -54,3 +94,11 @@ attributes #1 = { nounwind readnone spec
 !15 = !DILocalVariable(name: "c", arg: 3, scope: !7, file: !1, line: 1, type: !11)
 !16 = !DILocation(line: 1, column: 19, scope: !7)
 !17 = !DILocation(line: 2, column: 26, scope: !7)
+!18 = !DILocation(line: 3, column: 20, scope: !7)
+!19 = distinct !DISubprogram(name: "foo1", linkageName: "_Z4foo1ddb", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !20)
+!20 = !{!21, !22, !23}
+!21 = !DILocalVariable(name: "x", arg: 1, scope: !19, file: !1, line: 1, type: !10)
+!22 = !DILocalVariable(name: "y", arg: 2, scope: !19, file: !1, line: 1, type: !10)
+!23 = !DILocalVariable(name: "c", arg: 3, scope: !19, file: !1, line: 1, type: !11)
+!24 = !DILocation(line: 1, column: 19, scope: !19)
+!25 = !DILocation(line: 2, column: 26, scope: !19)

Modified: llvm/trunk/test/CodeGen/X86/machinesink-null-debuginfo.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/machinesink-null-debuginfo.ll?rev=321207&r1=321206&r2=321207&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/machinesink-null-debuginfo.ll (original)
+++ llvm/trunk/test/CodeGen/X86/machinesink-null-debuginfo.ll Wed Dec 20 11:11:31 2017
@@ -11,10 +11,10 @@ define double @_Z3fooddb(double %x, doub
   tail call void @llvm.dbg.value(metadata double %y, metadata !14, metadata !DIExpression()), !dbg !17
   tail call void @llvm.dbg.value(metadata i1 %c, metadata !15, metadata !DIExpression()), !dbg !18
   %a = fdiv double %x, 3.000000e+00
-  %b = fdiv double %y, 5.000000e+00, !dbg !21
+  %b = fdiv double %y, 5.000000e+00, !dbg !19
   %cond = select i1 %c,  double %a, double %b
-; CHECK-NOT: debug-location !21
-  ret double %cond, !dbg !22
+; CHECK-NOT: debug-location !19
+  ret double %cond, !dbg !20
 }
 
 ; Function Attrs: nounwind readnone speculatable
@@ -45,5 +45,5 @@ attributes #1 = { nounwind readnone spec
 !16 = !DILocation(line: 1, column: 19, scope: !7)
 !17 = !DILocation(line: 1, column: 29, scope: !7)
 !18 = !DILocation(line: 1, column: 37, scope: !7)
-!21 = !DILocation(line: 2, column: 26, scope: !7)
-!22 = !DILocation(line: 2, column: 3, scope: !7)
+!19 = !DILocation(line: 2, column: 26, scope: !7)
+!20 = !DILocation(line: 2, column: 3, scope: !7)




More information about the llvm-commits mailing list