1; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx | FileCheck %s --check-prefix=X64 2; 3; These cases check if x86_64-linux-android works with -O2 -g, 4; especially CSE matching needed by SoftenFloatRes_LOAD. 5; Multiple common load patterns are included to have better coverage. 6; When CSE matching fails, SoftenFloatResult and SoftenFloatRes_LOAD 7; can be called in an infinite loop. 8 9; ModuleID = 'fp128-g.c' 10source_filename = "fp128-g.c" 11target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 12target triple = "x86_64--linux-android" 13 14@ld_ptr = common local_unnamed_addr global fp128* null, align 8, !dbg !0 15 16; Function Attrs: nounwind readonly uwtable 17define fp128 @test_return1(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !11 { 18entry: 19 tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !15, metadata !16), !dbg !17 20 %0 = load fp128, fp128* %ptr, align 16, !dbg !18, !tbaa !19 21 ret fp128 %0, !dbg !23 22; X64-LABEL: test_return1: 23; X64: .loc 24; X64: movaps (%rdi), %xmm0 25; X64: .loc 26; X64: retq 27} 28 29; Function Attrs: nounwind readonly uwtable 30define fp128 @test_return2(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !24 { 31entry: 32 tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !26, metadata !16), !dbg !28 33 %0 = load fp128, fp128* %ptr, align 16, !dbg !29, !tbaa !19 34 tail call void @llvm.dbg.value(metadata fp128 %0, i64 0, metadata !27, metadata !16), !dbg !30 35 ret fp128 %0, !dbg !31 36; X64-LABEL: test_return2: 37; X64: .loc 38; X64: movaps (%rdi), %xmm0 39; X64: .loc 40; X64: retq 41} 42 43; Function Attrs: nounwind readonly uwtable 44define fp128 @test_return3(fp128* nocapture readonly %ptr) local_unnamed_addr #0 !dbg !32 { 45entry: 46 tail call void @llvm.dbg.value(metadata fp128* %ptr, i64 0, metadata !34, metadata !16), !dbg !35 47 %0 = load fp128, fp128* %ptr, align 16, !dbg !36, !tbaa !19 48 %add = fadd fp128 %0, %0, !dbg !37 49 ret fp128 %add, !dbg !38 50; X64-LABEL: test_return3: 51; X64: .loc 52; X64: movaps (%rdi), %xmm0 53; X64: .loc 54; X64: movaps %xmm0, %xmm1 55; X64: callq __addtf3 56; X64: .loc 57; X64: retq 58} 59 60; Function Attrs: norecurse nounwind readonly uwtable 61define fp128 @test_return4() local_unnamed_addr #1 !dbg !39 { 62entry: 63 %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !42, !tbaa !43 64 %1 = load fp128, fp128* %0, align 16, !dbg !45, !tbaa !19 65 ret fp128 %1, !dbg !46 66; X64-LABEL: test_return4: 67; X64: .loc 68; X64: movq ld_ptr(%rip), %rax 69; X64: .loc 70; X64: movaps (%rax), %xmm0 71; X64: .loc 72; X64: retq 73} 74 75; Function Attrs: nounwind readonly uwtable 76define fp128 @test_return5() local_unnamed_addr #0 !dbg !47 { 77entry: 78 %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !50, !tbaa !43 79 %1 = load fp128, fp128* %0, align 16, !dbg !51, !tbaa !19 80 tail call void @llvm.dbg.value(metadata fp128 %1, i64 0, metadata !49, metadata !16), !dbg !52 81 ret fp128 %1, !dbg !53 82; X64-LABEL: test_return5: 83; X64: .loc 84; X64: movq ld_ptr(%rip), %rax 85; X64: .loc 86; X64: movaps (%rax), %xmm0 87; X64: .loc 88; X64: retq 89} 90 91; Function Attrs: norecurse nounwind readonly uwtable 92define fp128 @test_return6() local_unnamed_addr #1 !dbg !54 { 93entry: 94 %0 = load fp128*, fp128** @ld_ptr, align 8, !dbg !55, !tbaa !43 95 %1 = load fp128, fp128* %0, align 16, !dbg !56, !tbaa !19 96 %add = fadd fp128 %1, %1, !dbg !57 97 ret fp128 %add, !dbg !58 98; X64-LABEL: test_return6: 99; X64: .loc 100; X64: movaps (%rax), %xmm0 101; X64: .loc 102; X64: movaps %xmm0, %xmm1 103; X64: callq __addtf3 104; X64: .loc 105; X64: retq 106} 107 108; Function Attrs: nounwind readnone 109declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 110 111attributes #0 = { nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 112attributes #1 = { norecurse nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } 113attributes #2 = { nounwind readnone } 114 115!llvm.dbg.cu = !{!1} 116!llvm.module.flags = !{!7, !8, !9} 117!llvm.ident = !{!10} 118 119!0 = distinct !DIGlobalVariable(name: "ld_ptr", scope: !1, file: !2, line: 17, type: !5, isLocal: false, isDefinition: true) 120!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (trunk 281495)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !3, globals: !4) 121!2 = !DIFile(filename: "fp128-g.c", directory: "/disk5/chh/Debug/ld.loop") 122!3 = !{} 123!4 = !{!0} 124!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64, align: 64) 125!6 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float) 126!7 = !{i32 2, !"Dwarf Version", i32 4} 127!8 = !{i32 2, !"Debug Info Version", i32 3} 128!9 = !{i32 1, !"PIC Level", i32 2} 129!10 = !{!"clang version 4.0.0 (trunk 281495)"} 130!11 = distinct !DISubprogram(name: "test_return1", scope: !2, file: !2, line: 3, type: !12, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !14) 131!12 = !DISubroutineType(types: !13) 132!13 = !{!6, !5} 133!14 = !{!15} 134!15 = !DILocalVariable(name: "ptr", arg: 1, scope: !11, file: !2, line: 3, type: !5) 135!16 = !DIExpression() 136!17 = !DILocation(line: 3, column: 39, scope: !11) 137!18 = !DILocation(line: 4, column: 12, scope: !11) 138!19 = !{!20, !20, i64 0} 139!20 = !{!"long double", !21, i64 0} 140!21 = !{!"omnipotent char", !22, i64 0} 141!22 = !{!"Simple C/C++ TBAA"} 142!23 = !DILocation(line: 4, column: 5, scope: !11) 143!24 = distinct !DISubprogram(name: "test_return2", scope: !2, file: !2, line: 7, type: !12, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !25) 144!25 = !{!26, !27} 145!26 = !DILocalVariable(name: "ptr", arg: 1, scope: !24, file: !2, line: 7, type: !5) 146!27 = !DILocalVariable(name: "value", scope: !24, file: !2, line: 8, type: !6) 147!28 = !DILocation(line: 7, column: 39, scope: !24) 148!29 = !DILocation(line: 9, column: 14, scope: !24) 149!30 = !DILocation(line: 8, column: 17, scope: !24) 150!31 = !DILocation(line: 10, column: 5, scope: !24) 151!32 = distinct !DISubprogram(name: "test_return3", scope: !2, file: !2, line: 13, type: !12, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !1, variables: !33) 152!33 = !{!34} 153!34 = !DILocalVariable(name: "ptr", arg: 1, scope: !32, file: !2, line: 13, type: !5) 154!35 = !DILocation(line: 13, column: 39, scope: !32) 155!36 = !DILocation(line: 14, column: 12, scope: !32) 156!37 = !DILocation(line: 14, column: 17, scope: !32) 157!38 = !DILocation(line: 14, column: 5, scope: !32) 158!39 = distinct !DISubprogram(name: "test_return4", scope: !2, file: !2, line: 18, type: !40, isLocal: false, isDefinition: true, scopeLine: 18, isOptimized: true, unit: !1, variables: !3) 159!40 = !DISubroutineType(types: !41) 160!41 = !{!6} 161!42 = !DILocation(line: 19, column: 13, scope: !39) 162!43 = !{!44, !44, i64 0} 163!44 = !{!"any pointer", !21, i64 0} 164!45 = !DILocation(line: 19, column: 12, scope: !39) 165!46 = !DILocation(line: 19, column: 5, scope: !39) 166!47 = distinct !DISubprogram(name: "test_return5", scope: !2, file: !2, line: 22, type: !40, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !1, variables: !48) 167!48 = !{!49} 168!49 = !DILocalVariable(name: "value", scope: !47, file: !2, line: 23, type: !6) 169!50 = !DILocation(line: 23, column: 26, scope: !47) 170!51 = !DILocation(line: 23, column: 25, scope: !47) 171!52 = !DILocation(line: 23, column: 17, scope: !47) 172!53 = !DILocation(line: 24, column: 5, scope: !47) 173!54 = distinct !DISubprogram(name: "test_return6", scope: !2, file: !2, line: 27, type: !40, isLocal: false, isDefinition: true, scopeLine: 27, isOptimized: true, unit: !1, variables: !3) 174!55 = !DILocation(line: 28, column: 13, scope: !54) 175!56 = !DILocation(line: 28, column: 12, scope: !54) 176!57 = !DILocation(line: 28, column: 20, scope: !54) 177!58 = !DILocation(line: 28, column: 5, scope: !54) 178