brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 8c198a3 Raw
77 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -codegenprepare %s | FileCheck %s3; Make sure BypassSlowDivision doesn't drop debug info4 5define i64 @sdiv64(i64 %a, i64 %b) {6; CHECK-LABEL: @sdiv64(7; CHECK-NEXT:    [[TMP1:%.*]] = or i64 [[A:%.*]], [[B:%.*]], [[DBG6:!dbg !.*]]8; CHECK-NEXT:    [[TMP2:%.*]] = and i64 [[TMP1]], -4294967296, [[DBG6]]9; CHECK-NEXT:    [[TMP3:%.*]] = icmp eq i64 [[TMP2]], 0, [[DBG6]]10; CHECK-NEXT:    br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP9:%.*]], [[DBG6]]11; CHECK:       4:12; CHECK-NEXT:    [[TMP5:%.*]] = trunc i64 [[B]] to i32, [[DBG6]]13; CHECK-NEXT:    [[TMP6:%.*]] = trunc i64 [[A]] to i32, [[DBG6]]14; CHECK-NEXT:    [[TMP7:%.*]] = udiv i32 [[TMP6]], [[TMP5]], [[DBG6]]15; CHECK-NEXT:    [[TMP8:%.*]] = zext i32 [[TMP7]] to i64, [[DBG6]]16; CHECK-NEXT:    br label [[TMP11:%.*]], [[DBG6]]17; CHECK:       9:18; CHECK-NEXT:    [[TMP10:%.*]] = sdiv i64 [[A]], [[B]], [[DBG6]]19; CHECK-NEXT:    br label [[TMP11]], [[DBG6]]20; CHECK:       11:21; CHECK-NEXT:    [[TMP12:%.*]] = phi i64 [ [[TMP8]], [[TMP4]] ], [ [[TMP10]], [[TMP9]] ], [[DBG6]]22; CHECK-NEXT:    ret i64 [[TMP12]]23;24  %d = sdiv i64 %a, %b, !dbg !625  ret i64 %d26}27 28; FIXME: The debugloc for the rem parts end up with the dbg of the29; division.30define <2 x i64> @sdivrem64(i64 %a, i64 %b) {31; CHECK-LABEL: @sdivrem64(32; CHECK-NEXT:    [[TMP1:%.*]] = or i64 [[A:%.*]], [[B:%.*]], [[DBG6]]33; CHECK-NEXT:    [[TMP2:%.*]] = and i64 [[TMP1]], -4294967296, [[DBG6]]34; CHECK-NEXT:    [[TMP3:%.*]] = icmp eq i64 [[TMP2]], 0, [[DBG6]]35; CHECK-NEXT:    br i1 [[TMP3]], label [[TMP4:%.*]], label [[TMP11:%.*]], [[DBG6]]36; CHECK:       4:37; CHECK-NEXT:    [[TMP5:%.*]] = trunc i64 [[B]] to i32, [[DBG6]]38; CHECK-NEXT:    [[TMP6:%.*]] = trunc i64 [[A]] to i32, [[DBG6]]39; CHECK-NEXT:    [[TMP7:%.*]] = udiv i32 [[TMP6]], [[TMP5]], [[DBG6]]40; CHECK-NEXT:    [[TMP8:%.*]] = urem i32 [[TMP6]], [[TMP5]], [[DBG6]]41; CHECK-NEXT:    [[TMP9:%.*]] = zext i32 [[TMP7]] to i64, [[DBG6]]42; CHECK-NEXT:    [[TMP10:%.*]] = zext i32 [[TMP8]] to i64, [[DBG6]]43; CHECK-NEXT:    br label [[TMP14:%.*]], [[DBG6]]44; CHECK:       11:45; CHECK-NEXT:    [[TMP12:%.*]] = sdiv i64 [[A]], [[B]], [[DBG6]]46; CHECK-NEXT:    [[TMP13:%.*]] = srem i64 [[A]], [[B]], [[DBG6]]47; CHECK-NEXT:    br label [[TMP14]], [[DBG6]]48; CHECK:       14:49; CHECK-NEXT:    [[TMP15:%.*]] = phi i64 [ [[TMP9]], [[TMP4]] ], [ [[TMP12]], [[TMP11]] ], [[DBG6]]50; CHECK-NEXT:    [[TMP16:%.*]] = phi i64 [ [[TMP10]], [[TMP4]] ], [ [[TMP13]], [[TMP11]] ], [[DBG6]]51; CHECK-NEXT:    [[INS0:%.*]] = insertelement <2 x i64> poison, i64 [[TMP15]], i32 052; CHECK-NEXT:    [[INS1:%.*]] = insertelement <2 x i64> [[INS0]], i64 [[TMP16]], i32 153; CHECK-NEXT:    ret <2 x i64> [[INS1]]54;55  %d = sdiv i64 %a, %b, !dbg !656  %r = srem i64 %a, %b, !dbg !1057  %ins0 = insertelement <2 x i64> poison, i64 %d, i32 058  %ins1 = insertelement <2 x i64> %ins0, i64 %r, i32 159  ret <2 x i64> %ins160}61 62!llvm.dbg.cu = !{!0}63!llvm.module.flags = !{!3, !4}64!llvm.ident = !{!5}65 66!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.5 ", isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug, enums: !2, retainedTypes: !2, globals: !2, imports: !2)67!1 = !DIFile(filename: "basic.c", directory: ".")68!2 = !{}69!3 = !{i32 2, !"Dwarf Version", i32 4}70!4 = !{i32 1, !"Debug Info Version", i32 3}71!5 = !{!"clang version 3.5 "}72!6 = !DILocation(line: 3, scope: !7)73!7 = distinct !DILexicalBlock(scope: !8, file: !1, line: 3)74!8 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !9, scopeLine: 1, virtualIndex: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)75!9 = !DISubroutineType(types: !2)76!10 = !DILocation(line: 4, scope: !7)77