xref: /llvm-project/llvm/test/Transforms/CorrelatedValuePropagation/srem_missing_debugloc.ll (revision ebd0249fcf672ca164e6cc21379f1c62807b6d56)
1; RUN: opt -passes=correlated-propagation -S < %s | FileCheck %s
2; CHECK: %{{[a-zA-Z0-9_]*}} = urem i8 %x.nonneg, %y.nonneg, !dbg ![[DBGLOC:[0-9]+]]
3; CHECK-NEXT: %{{[a-zA-Z0-9_]*}}.neg = sub i8 0, %rem1, !dbg ![[DBGLOC]]
4
5; ModuleID = 'reduced.ll'
6source_filename = "orig.ll"
7target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
8target triple = "thumbv7m-arm-none-eabi"
9
10; Function Attrs: inaccessiblememonly nocallback nofree nosync nounwind willreturn
11declare void @llvm.assume(i1 noundef) #0
12
13define void @test8_neg_neg(i8 %x, i8 %y) !dbg !5 {
14  %c0 = icmp sle i8 %x, 0, !dbg !13
15  call void @llvm.dbg.value(metadata i1 %c0, metadata !9, metadata !DIExpression()), !dbg !13
16  call void @llvm.assume(i1 %c0), !dbg !14
17  %c1 = icmp sle i8 %y, 0, !dbg !15
18  call void @llvm.dbg.value(metadata i1 %c1, metadata !11, metadata !DIExpression()), !dbg !15
19  call void @llvm.assume(i1 %c1), !dbg !16
20  %rem = srem i8 %x, %y, !dbg !17
21  call void @llvm.dbg.value(metadata i8 %rem, metadata !12, metadata !DIExpression()), !dbg !17
22  ret void, !dbg !18
23}
24
25; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
26declare void @llvm.dbg.value(metadata, metadata, metadata) #1
27
28!llvm.module.flags = !{!0}
29!llvm.dbg.cu = !{!1}
30!llvm.debugify = !{!3, !4}
31
32!0 = !{i32 2, !"Debug Info Version", i32 3}
33!1 = distinct !DICompileUnit(language: DW_LANG_C, file: !2, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
34!2 = !DIFile(filename: "reduced.ll", directory: "/")
35!3 = !{i32 6}
36!4 = !{i32 3}
37!5 = distinct !DISubprogram(name: "test8_neg_neg", linkageName: "test8_neg_neg", scope: null, file: !2, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !1, retainedNodes: !8)
38!6 = !DISubroutineType(types: !7)
39!7 = !{}
40!8 = !{!9, !11, !12}
41!9 = !DILocalVariable(name: "1", scope: !5, file: !2, line: 1, type: !10)
42!10 = !DIBasicType(name: "ty8", size: 8, encoding: DW_ATE_unsigned)
43!11 = !DILocalVariable(name: "2", scope: !5, file: !2, line: 3, type: !10)
44!12 = !DILocalVariable(name: "3", scope: !5, file: !2, line: 5, type: !10)
45!13 = !DILocation(line: 1, column: 1, scope: !5)
46!14 = !DILocation(line: 2, column: 1, scope: !5)
47!15 = !DILocation(line: 3, column: 1, scope: !5)
48!16 = !DILocation(line: 4, column: 1, scope: !5)
49!17 = !DILocation(line: 5, column: 1, scope: !5)
50!18 = !DILocation(line: 6, column: 1, scope: !5)
51