178 lines · plain
1; RUN: llc < %s -O2 -mtriple=x86_64-linux-android -mattr=+mmx \2; RUN: -enable-legalize-types-checking | FileCheck %s --check-prefix=X643;4; These cases check if x86_64-linux-android works with -O2 -g,5; especially CSE matching needed by SoftenFloatRes_LOAD.6; Multiple common load patterns are included to have better coverage.7; When CSE matching fails, SoftenFloatResult and SoftenFloatRes_LOAD8; can be called in an infinite loop.9 10; ModuleID = 'fp128-g.c'11source_filename = "fp128-g.c"12target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"13target triple = "x86_64--linux-android"14 15@ld_ptr = common dso_local local_unnamed_addr global ptr null, align 8, !dbg !016 17; Function Attrs: nounwind readonly uwtable18define fp128 @test_return1(ptr nocapture readonly %ptr) local_unnamed_addr #0 !dbg !12 {19entry:20 tail call void @llvm.dbg.value(metadata ptr %ptr, i64 0, metadata !16, metadata !17), !dbg !1821 %0 = load fp128, ptr %ptr, align 16, !dbg !19, !tbaa !2022 ret fp128 %0, !dbg !2423; X64-LABEL: test_return1:24; X64: .loc25; X64: movaps (%rdi), %xmm026; X64: .loc27; X64: retq28}29 30; Function Attrs: nounwind readonly uwtable31define fp128 @test_return2(ptr nocapture readonly %ptr) local_unnamed_addr #0 !dbg !25 {32entry:33 tail call void @llvm.dbg.value(metadata ptr %ptr, i64 0, metadata !27, metadata !17), !dbg !2934 %0 = load fp128, ptr %ptr, align 16, !dbg !30, !tbaa !2035 tail call void @llvm.dbg.value(metadata fp128 %0, i64 0, metadata !28, metadata !17), !dbg !3136 ret fp128 %0, !dbg !3237}38 39; X64-LABEL: test_return2:40; X64: .loc41; X64: movaps (%rdi), %xmm042; X64: .loc43; X64: retq44; Function Attrs: nounwind readonly uwtable45 46define fp128 @test_return3(ptr nocapture readonly %ptr) local_unnamed_addr #0 !dbg !33 {47entry:48 tail call void @llvm.dbg.value(metadata ptr %ptr, i64 0, metadata !35, metadata !17), !dbg !3649 %0 = load fp128, ptr %ptr, align 16, !dbg !37, !tbaa !2050 %add = fadd fp128 %0, %0, !dbg !3851 ret fp128 %add, !dbg !3952; X64-LABEL: test_return3:53; X64: .loc54; X64: movaps (%rdi), %xmm055; X64: .loc56; X64: movaps %xmm0, %xmm157; X64: jmp __addtf358}59 60; Function Attrs: norecurse nounwind readonly uwtable61define fp128 @test_return4() local_unnamed_addr #1 !dbg !40 {62entry:63 %0 = load ptr, ptr @ld_ptr, align 8, !dbg !43, !tbaa !4464 %1 = load fp128, ptr %0, align 16, !dbg !46, !tbaa !2065 ret fp128 %1, !dbg !4766; X64-LABEL: test_return4:67; X64: .loc68; X64: movq ld_ptr(%rip), %rax69; X64: .loc70; X64: movaps (%rax), %xmm071; X64: .loc72; X64: retq73}74 75; Function Attrs: nounwind readonly uwtable76define fp128 @test_return5() local_unnamed_addr #0 !dbg !48 {77entry:78 %0 = load ptr, ptr @ld_ptr, align 8, !dbg !51, !tbaa !4479 %1 = load fp128, ptr %0, align 16, !dbg !52, !tbaa !2080 tail call void @llvm.dbg.value(metadata fp128 %1, i64 0, metadata !50, metadata !17), !dbg !5381 ret fp128 %1, !dbg !5482; X64-LABEL: test_return5:83; X64: .loc84; X64: movq ld_ptr(%rip), %rax85; X64: .loc86; X64: movaps (%rax), %xmm087; X64: .loc88; X64: retq89}90 91; Function Attrs: norecurse nounwind readonly uwtable92define fp128 @test_return6() local_unnamed_addr #1 !dbg !55 {93entry:94 %0 = load ptr, ptr @ld_ptr, align 8, !dbg !56, !tbaa !4495 %1 = load fp128, ptr %0, align 16, !dbg !57, !tbaa !2096 %add = fadd fp128 %1, %1, !dbg !5897 ret fp128 %add, !dbg !5998; X64-LABEL: test_return6:99; X64: .loc100; X64: movaps (%rax), %xmm0101; X64: .loc102; X64: movaps %xmm0, %xmm1103; X64: jmp __addtf3104}105 106; Function Attrs: nounwind readnone107declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2108 109attributes #0 = { nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "use-soft-float"="false" }110attributes #1 = { norecurse nounwind readonly uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" "use-soft-float"="false" }111attributes #2 = { nounwind readnone }112 113!llvm.dbg.cu = !{!2}114!llvm.module.flags = !{!8, !9, !10}115!llvm.ident = !{!11}116 117!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())118!1 = !DIGlobalVariable(name: "ld_ptr", scope: !2, file: !3, line: 17, type: !6, isLocal: false, isDefinition: true)119!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 4.0.0 (trunk 281495)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)120!3 = !DIFile(filename: "fp128-g.c", directory: "/disk5/chh/Debug/ld.loop")121!4 = !{}122!5 = !{!0}123!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)124!7 = !DIBasicType(name: "long double", size: 128, align: 128, encoding: DW_ATE_float)125!8 = !{i32 2, !"Dwarf Version", i32 4}126!9 = !{i32 2, !"Debug Info Version", i32 3}127!10 = !{i32 1, !"PIC Level", i32 2}128!11 = !{!"clang version 4.0.0 (trunk 281495)"}129!12 = distinct !DISubprogram(name: "test_return1", scope: !3, file: !3, line: 3, type: !13, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !15)130!13 = !DISubroutineType(types: !14)131!14 = !{!7, !6}132!15 = !{!16}133!16 = !DILocalVariable(name: "ptr", arg: 1, scope: !12, file: !3, line: 3, type: !6)134!17 = !DIExpression()135!18 = !DILocation(line: 3, column: 39, scope: !12)136!19 = !DILocation(line: 4, column: 12, scope: !12)137!20 = !{!21, !21, i64 0}138!21 = !{!"long double", !22, i64 0}139!22 = !{!"omnipotent char", !23, i64 0}140!23 = !{!"Simple C/C++ TBAA"}141!24 = !DILocation(line: 4, column: 5, scope: !12)142!25 = distinct !DISubprogram(name: "test_return2", scope: !3, file: !3, line: 7, type: !13, isLocal: false, isDefinition: true, scopeLine: 7, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !26)143!26 = !{!27, !28}144!27 = !DILocalVariable(name: "ptr", arg: 1, scope: !25, file: !3, line: 7, type: !6)145!28 = !DILocalVariable(name: "value", scope: !25, file: !3, line: 8, type: !7)146!29 = !DILocation(line: 7, column: 39, scope: !25)147!30 = !DILocation(line: 9, column: 14, scope: !25)148!31 = !DILocation(line: 8, column: 17, scope: !25)149!32 = !DILocation(line: 10, column: 5, scope: !25)150!33 = distinct !DISubprogram(name: "test_return3", scope: !3, file: !3, line: 13, type: !13, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !2, retainedNodes: !34)151!34 = !{!35}152!35 = !DILocalVariable(name: "ptr", arg: 1, scope: !33, file: !3, line: 13, type: !6)153!36 = !DILocation(line: 13, column: 39, scope: !33)154!37 = !DILocation(line: 14, column: 12, scope: !33)155!38 = !DILocation(line: 14, column: 17, scope: !33)156!39 = !DILocation(line: 14, column: 5, scope: !33)157!40 = distinct !DISubprogram(name: "test_return4", scope: !3, file: !3, line: 18, type: !41, isLocal: false, isDefinition: true, scopeLine: 18, isOptimized: true, unit: !2, retainedNodes: !4)158!41 = !DISubroutineType(types: !42)159!42 = !{!7}160!43 = !DILocation(line: 19, column: 13, scope: !40)161!44 = !{!45, !45, i64 0}162!45 = !{!"any pointer", !22, i64 0}163!46 = !DILocation(line: 19, column: 12, scope: !40)164!47 = !DILocation(line: 19, column: 5, scope: !40)165!48 = distinct !DISubprogram(name: "test_return5", scope: !3, file: !3, line: 22, type: !41, isLocal: false, isDefinition: true, scopeLine: 22, isOptimized: true, unit: !2, retainedNodes: !49)166!49 = !{!50}167!50 = !DILocalVariable(name: "value", scope: !48, file: !3, line: 23, type: !7)168!51 = !DILocation(line: 23, column: 26, scope: !48)169!52 = !DILocation(line: 23, column: 25, scope: !48)170!53 = !DILocation(line: 23, column: 17, scope: !48)171!54 = !DILocation(line: 24, column: 5, scope: !48)172!55 = distinct !DISubprogram(name: "test_return6", scope: !3, file: !3, line: 27, type: !41, isLocal: false, isDefinition: true, scopeLine: 27, isOptimized: true, unit: !2, retainedNodes: !4)173!56 = !DILocation(line: 28, column: 13, scope: !55)174!57 = !DILocation(line: 28, column: 12, scope: !55)175!58 = !DILocation(line: 28, column: 20, scope: !55)176!59 = !DILocation(line: 28, column: 5, scope: !55)177 178