122f12179SDavid Stenberg; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3 222f12179SDavid Stenberg; RUN: llc -mtriple=sparcv9 %s -start-before=sparc-isel -o - -stop-after=sparc-isel | FileCheck %s 322f12179SDavid Stenberg 422f12179SDavid Stenbergtarget datalayout = "E-m:e-i64:64-n32:64-S128" 522f12179SDavid Stenbergtarget triple = "sparcv9" 622f12179SDavid Stenberg 722f12179SDavid Stenbergdefine void @pointer_add_unknown_offset(ptr %base, i32 %offset) !dbg !7 { 822f12179SDavid Stenberg ; CHECK-LABEL: name: pointer_add_unknown_offset 922f12179SDavid Stenberg ; CHECK: bb.0.entry: 1022f12179SDavid Stenberg ; CHECK-NEXT: liveins: $i0, $i1 1122f12179SDavid Stenberg ; CHECK-NEXT: {{ $}} 1222f12179SDavid Stenberg ; CHECK-NEXT: [[COPY:%[0-9]+]]:i64regs = COPY $i1 1322f12179SDavid Stenberg ; CHECK-NEXT: [[COPY1:%[0-9]+]]:i64regs = COPY $i0 1422f12179SDavid Stenberg ; CHECK-NEXT: [[SRAri:%[0-9]+]]:i64regs = SRAri [[COPY]], 0 15*ced15cd4SMatt Arsenault ; CHECK-NEXT: [[SLLXri:%[0-9]+]]:i64regs = nsw SLLXri killed [[SRAri]], 2 1622f12179SDavid Stenberg ; CHECK-NEXT: DBG_VALUE_LIST !13, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_stack_value), [[COPY1]], [[SLLXri]], debug-location !16 1722f12179SDavid Stenberg ; CHECK-NEXT: DBG_VALUE_LIST !14, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus, DW_OP_plus_uconst, 3, DW_OP_stack_value), [[COPY1]], [[SLLXri]], debug-location !16 1822f12179SDavid Stenberg ; CHECK-NEXT: DBG_VALUE_LIST !15, !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 2, DW_OP_plus, DW_OP_LLVM_arg, 1, DW_OP_LLVM_arg, 3, DW_OP_plus, DW_OP_plus, DW_OP_stack_value), [[COPY1]], [[COPY1]], [[SLLXri]], [[SLLXri]], debug-location !16 1922f12179SDavid Stenberg ; CHECK-NEXT: [[ORri:%[0-9]+]]:intregs = ORri $g0, 42 2022f12179SDavid Stenberg ; CHECK-NEXT: STrr [[COPY1]], killed [[SLLXri]], killed [[ORri]] :: (store (s32) into %ir.add.ptr) 2122f12179SDavid Stenberg ; CHECK-NEXT: RETL 8 2222f12179SDavid Stenbergentry: 2322f12179SDavid Stenberg %idx.ext = sext i32 %offset to i64 2422f12179SDavid Stenberg %add.ptr = getelementptr inbounds i32, ptr %base, i64 %idx.ext 2522f12179SDavid Stenberg call void @llvm.dbg.value(metadata ptr %add.ptr, metadata !13, metadata !DIExpression()), !dbg !16 2622f12179SDavid Stenberg call void @llvm.dbg.value(metadata ptr %add.ptr, metadata !14, metadata !DIExpression(DW_OP_plus_uconst, 3, DW_OP_stack_value)), !dbg !16 2722f12179SDavid Stenberg call void @llvm.dbg.value(metadata !DIArgList(ptr %add.ptr, ptr %add.ptr), metadata !15, metadata !DIExpression(DW_OP_LLVM_arg, 0, DW_OP_LLVM_arg, 1, DW_OP_plus)), !dbg !16 2822f12179SDavid Stenberg store i32 42, ptr %add.ptr, align 4 2922f12179SDavid Stenberg ret void 3022f12179SDavid Stenberg} 3122f12179SDavid Stenberg 3222f12179SDavid Stenbergdeclare void @llvm.dbg.value(metadata, metadata, metadata) 3322f12179SDavid Stenberg 3422f12179SDavid Stenberg!llvm.dbg.cu = !{!0} 3522f12179SDavid Stenberg!llvm.module.flags = !{!2, !3, !4, !5} 3622f12179SDavid Stenberg!llvm.ident = !{!6} 3722f12179SDavid Stenberg 3822f12179SDavid Stenberg!0 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None) 3922f12179SDavid Stenberg!1 = !DIFile(filename: "test.c", directory: "/tmp", checksumkind: CSK_MD5, checksum: "4321633e52cefeee6e307c697a82574f") 4022f12179SDavid Stenberg!2 = !{i32 7, !"Dwarf Version", i32 5} 4122f12179SDavid Stenberg!3 = !{i32 2, !"Debug Info Version", i32 3} 4222f12179SDavid Stenberg!4 = !{i32 1, !"wchar_size", i32 4} 4322f12179SDavid Stenberg!5 = !{i32 7, !"debug-info-assignment-tracking", i1 true} 4422f12179SDavid Stenberg!6 = !{!"clang"} 4522f12179SDavid Stenberg!7 = distinct !DISubprogram(name: "pointer_add_unknown_offset", scope: !1, file: !1, line: 1, type: !8, scopeLine: 1, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !12) 4622f12179SDavid Stenberg!8 = !DISubroutineType(types: !9) 4722f12179SDavid Stenberg!9 = !{null, !10, !11} 4822f12179SDavid Stenberg!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64) 4922f12179SDavid Stenberg!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 5022f12179SDavid Stenberg!12 = !{!13, !14, !15} 5122f12179SDavid Stenberg!13 = !DILocalVariable(name: "p", scope: !7, file: !1, line: 2, type: !10) 5222f12179SDavid Stenberg!14 = !DILocalVariable(name: "q", scope: !7, file: !1, line: 2, type: !10) 5322f12179SDavid Stenberg!15 = !DILocalVariable(name: "r", scope: !7, file: !1, line: 2, type: !10) 5422f12179SDavid Stenberg!16 = !DILocation(line: 0, scope: !7) 55