1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-linux-gnu < %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; Verify that we no longer crash in VSX swap removal when debug values 4*9880d681SAndroid Build Coastguard Worker; are in the code stream. 5*9880d681SAndroid Build Coastguard Worker 6*9880d681SAndroid Build Coastguard Worker@php_intpow10.powers = external unnamed_addr constant [23 x double], align 8 7*9880d681SAndroid Build Coastguard Worker 8*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 9*9880d681SAndroid Build Coastguard Workerdefine double @_php_math_round(double %value, i32 signext %places, i32 signext %mode) #0 !dbg !6 { 10*9880d681SAndroid Build Coastguard Workerentry: 11*9880d681SAndroid Build Coastguard Worker br i1 undef, label %if.then, label %if.else, !dbg !32 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Workerif.then: ; preds = %entry 14*9880d681SAndroid Build Coastguard Worker %conv = sitofp i32 undef to double, !dbg !34 15*9880d681SAndroid Build Coastguard Worker br i1 undef, label %if.then.i, label %if.end.i, !dbg !36 16*9880d681SAndroid Build Coastguard Worker 17*9880d681SAndroid Build Coastguard Workerif.then.i: ; preds = %if.then 18*9880d681SAndroid Build Coastguard Worker %call.i = tail call double @pow(double 1.000000e+01, double undef) #3, !dbg !39 19*9880d681SAndroid Build Coastguard Worker br label %php_intpow10.exit, !dbg !41 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Workerif.end.i: ; preds = %if.then 22*9880d681SAndroid Build Coastguard Worker %0 = load double, double* undef, align 8, !dbg !42, !tbaa !43 23*9880d681SAndroid Build Coastguard Worker br label %php_intpow10.exit, !dbg !47 24*9880d681SAndroid Build Coastguard Worker 25*9880d681SAndroid Build Coastguard Workerphp_intpow10.exit: ; preds = %if.end.i, %if.then.i 26*9880d681SAndroid Build Coastguard Worker %retval.0.i = phi double [ %call.i, %if.then.i ], [ %0, %if.end.i ], !dbg !48 27*9880d681SAndroid Build Coastguard Worker tail call void @llvm.dbg.value(metadata double %retval.0.i, i64 0, metadata !15, metadata !49), !dbg !50 28*9880d681SAndroid Build Coastguard Worker %div = fdiv double %conv, %retval.0.i, !dbg !51 29*9880d681SAndroid Build Coastguard Worker br label %if.end.15, !dbg !52 30*9880d681SAndroid Build Coastguard Worker 31*9880d681SAndroid Build Coastguard Workerif.else: ; preds = %entry 32*9880d681SAndroid Build Coastguard Worker %mul = fmul double %value, undef, !dbg !53 33*9880d681SAndroid Build Coastguard Worker br label %if.end.15 34*9880d681SAndroid Build Coastguard Worker 35*9880d681SAndroid Build Coastguard Workerif.end.15: ; preds = %if.else, %php_intpow10.exit 36*9880d681SAndroid Build Coastguard Worker %tmp_value.1 = phi double [ %div, %php_intpow10.exit ], [ %mul, %if.else ] 37*9880d681SAndroid Build Coastguard Worker ret double %tmp_value.1, !dbg !57 38*9880d681SAndroid Build Coastguard Worker} 39*9880d681SAndroid Build Coastguard Worker 40*9880d681SAndroid Build Coastguard Workerdeclare signext i32 @php_intlog10abs(...) #1 41*9880d681SAndroid Build Coastguard Worker 42*9880d681SAndroid Build Coastguard Workerdeclare signext i32 @php_round_helper(...) #1 43*9880d681SAndroid Build Coastguard Worker 44*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind 45*9880d681SAndroid Build Coastguard Workerdeclare double @pow(double, double) #0 46*9880d681SAndroid Build Coastguard Worker 47*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone 48*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.value(metadata, i64, metadata, metadata) #2 49*9880d681SAndroid Build Coastguard Worker 50*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64le" "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+power8-vector,+vsx,-qpx" "unsafe-fp-math"="false" "use-soft-float"="false" } 51*9880d681SAndroid Build Coastguard Workerattributes #1 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="ppc64le" "target-features"="+altivec,+bpermd,+crypto,+direct-move,+extdiv,+power8-vector,+vsx,-qpx" "unsafe-fp-math"="false" "use-soft-float"="false" } 52*9880d681SAndroid Build Coastguard Workerattributes #2 = { nounwind readnone } 53*9880d681SAndroid Build Coastguard Workerattributes #3 = { nounwind } 54*9880d681SAndroid Build Coastguard Worker 55*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0} 56*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!29, !30} 57*9880d681SAndroid Build Coastguard Worker!llvm.ident = !{!31} 58*9880d681SAndroid Build Coastguard Worker 59*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 (git://github.com/llvm-mirror/clang.git e0848b6353721eb1b278a5bbea257bbf6316251e) (git://github.com/llvm-mirror/llvm.git 8724a428dfd5e78d7865bb01783708e83f9ed128)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !23) 60*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "testcase.i", directory: "/tmp/glibc.build") 61*9880d681SAndroid Build Coastguard Worker!2 = !{} 62*9880d681SAndroid Build Coastguard Worker!3 = !{!4} 63*9880d681SAndroid Build Coastguard Worker!4 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) 64*9880d681SAndroid Build Coastguard Worker!6 = distinct !DISubprogram(name: "_php_math_round", scope: !1, file: !1, line: 15, type: !7, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !10) 65*9880d681SAndroid Build Coastguard Worker!7 = !DISubroutineType(types: !8) 66*9880d681SAndroid Build Coastguard Worker!8 = !{!4, !4, !9, !9} 67*9880d681SAndroid Build Coastguard Worker!9 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 68*9880d681SAndroid Build Coastguard Worker!10 = !{!11, !12, !13, !14, !15, !16, !17} 69*9880d681SAndroid Build Coastguard Worker!11 = !DILocalVariable(name: "value", arg: 1, scope: !6, file: !1, line: 15, type: !4) 70*9880d681SAndroid Build Coastguard Worker!12 = !DILocalVariable(name: "places", arg: 2, scope: !6, file: !1, line: 15, type: !9) 71*9880d681SAndroid Build Coastguard Worker!13 = !DILocalVariable(name: "mode", arg: 3, scope: !6, file: !1, line: 15, type: !9) 72*9880d681SAndroid Build Coastguard Worker!14 = !DILocalVariable(name: "f1", scope: !6, file: !1, line: 17, type: !4) 73*9880d681SAndroid Build Coastguard Worker!15 = !DILocalVariable(name: "f2", scope: !6, file: !1, line: 17, type: !4) 74*9880d681SAndroid Build Coastguard Worker!16 = !DILocalVariable(name: "tmp_value", scope: !6, file: !1, line: 18, type: !4) 75*9880d681SAndroid Build Coastguard Worker!17 = !DILocalVariable(name: "precision_places", scope: !6, file: !1, line: 19, type: !9) 76*9880d681SAndroid Build Coastguard Worker!18 = distinct !DISubprogram(name: "php_intpow10", scope: !1, file: !1, line: 1, type: !19, isLocal: true, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !21) 77*9880d681SAndroid Build Coastguard Worker!19 = !DISubroutineType(types: !20) 78*9880d681SAndroid Build Coastguard Worker!20 = !{!4, !9} 79*9880d681SAndroid Build Coastguard Worker!21 = !{!22} 80*9880d681SAndroid Build Coastguard Worker!22 = !DILocalVariable(name: "power", arg: 1, scope: !18, file: !1, line: 1, type: !9) 81*9880d681SAndroid Build Coastguard Worker!23 = !{!24} 82*9880d681SAndroid Build Coastguard Worker!24 = !DIGlobalVariable(name: "powers", scope: !18, file: !1, line: 3, type: !25, isLocal: true, isDefinition: true, variable: [23 x double]* @php_intpow10.powers) 83*9880d681SAndroid Build Coastguard Worker!25 = !DICompositeType(tag: DW_TAG_array_type, baseType: !26, size: 1472, align: 64, elements: !27) 84*9880d681SAndroid Build Coastguard Worker!26 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4) 85*9880d681SAndroid Build Coastguard Worker!27 = !{!28} 86*9880d681SAndroid Build Coastguard Worker!28 = !DISubrange(count: 23) 87*9880d681SAndroid Build Coastguard Worker!29 = !{i32 2, !"Dwarf Version", i32 4} 88*9880d681SAndroid Build Coastguard Worker!30 = !{i32 2, !"Debug Info Version", i32 3} 89*9880d681SAndroid Build Coastguard Worker!31 = !{!"clang version 3.8.0 (git://github.com/llvm-mirror/clang.git e0848b6353721eb1b278a5bbea257bbf6316251e) (git://github.com/llvm-mirror/llvm.git 8724a428dfd5e78d7865bb01783708e83f9ed128)"} 90*9880d681SAndroid Build Coastguard Worker!32 = !DILocation(line: 21, column: 32, scope: !33) 91*9880d681SAndroid Build Coastguard Worker!33 = distinct !DILexicalBlock(scope: !6, file: !1, line: 21, column: 6) 92*9880d681SAndroid Build Coastguard Worker!34 = !DILocation(line: 22, column: 15, scope: !35) 93*9880d681SAndroid Build Coastguard Worker!35 = distinct !DILexicalBlock(scope: !33, file: !1, line: 21, column: 67) 94*9880d681SAndroid Build Coastguard Worker!36 = !DILocation(line: 8, column: 16, scope: !37, inlinedAt: !38) 95*9880d681SAndroid Build Coastguard Worker!37 = distinct !DILexicalBlock(scope: !18, file: !1, line: 8, column: 6) 96*9880d681SAndroid Build Coastguard Worker!38 = distinct !DILocation(line: 23, column: 8, scope: !35) 97*9880d681SAndroid Build Coastguard Worker!39 = !DILocation(line: 9, column: 10, scope: !40, inlinedAt: !38) 98*9880d681SAndroid Build Coastguard Worker!40 = distinct !DILexicalBlock(scope: !37, file: !1, line: 8, column: 31) 99*9880d681SAndroid Build Coastguard Worker!41 = !DILocation(line: 9, column: 3, scope: !40, inlinedAt: !38) 100*9880d681SAndroid Build Coastguard Worker!42 = !DILocation(line: 11, column: 9, scope: !18, inlinedAt: !38) 101*9880d681SAndroid Build Coastguard Worker!43 = !{!44, !44, i64 0} 102*9880d681SAndroid Build Coastguard Worker!44 = !{!"double", !45, i64 0} 103*9880d681SAndroid Build Coastguard Worker!45 = !{!"omnipotent char", !46, i64 0} 104*9880d681SAndroid Build Coastguard Worker!46 = !{!"Simple C/C++ TBAA"} 105*9880d681SAndroid Build Coastguard Worker!47 = !DILocation(line: 11, column: 2, scope: !18, inlinedAt: !38) 106*9880d681SAndroid Build Coastguard Worker!48 = !DILocation(line: 23, column: 8, scope: !35) 107*9880d681SAndroid Build Coastguard Worker!49 = !DIExpression() 108*9880d681SAndroid Build Coastguard Worker!50 = !DILocation(line: 17, column: 13, scope: !6) 109*9880d681SAndroid Build Coastguard Worker!51 = !DILocation(line: 24, column: 25, scope: !35) 110*9880d681SAndroid Build Coastguard Worker!52 = !DILocation(line: 25, column: 2, scope: !35) 111*9880d681SAndroid Build Coastguard Worker!53 = !DILocation(line: 27, column: 22, scope: !54) 112*9880d681SAndroid Build Coastguard Worker!54 = distinct !DILexicalBlock(scope: !55, file: !1, line: 26, column: 20) 113*9880d681SAndroid Build Coastguard Worker!55 = distinct !DILexicalBlock(scope: !56, file: !1, line: 26, column: 7) 114*9880d681SAndroid Build Coastguard Worker!56 = distinct !DILexicalBlock(scope: !33, file: !1, line: 25, column: 9) 115*9880d681SAndroid Build Coastguard Worker!57 = !DILocation(line: 32, column: 2, scope: !6) 116