1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker 3*9880d681SAndroid Build Coastguard Worker; Check that we do not get excessive spilling from splitting of constant live ranges. 4*9880d681SAndroid Build Coastguard Worker 5*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: PR24139: 6*9880d681SAndroid Build Coastguard Worker; CHECK: # 16-byte Spill 7*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: # 16-byte Spill 8*9880d681SAndroid Build Coastguard Worker; CHECK: retq 9*9880d681SAndroid Build Coastguard Worker 10*9880d681SAndroid Build Coastguard Workerdefine <2 x double> @PR24139(<2 x double> %arg, <2 x double> %arg1, <2 x double> %arg2) { 11*9880d681SAndroid Build Coastguard Worker %tmp = bitcast <2 x double> %arg to <4 x float> 12*9880d681SAndroid Build Coastguard Worker %tmp3 = fmul <4 x float> %tmp, <float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000> 13*9880d681SAndroid Build Coastguard Worker %tmp4 = bitcast <2 x double> %arg to <4 x i32> 14*9880d681SAndroid Build Coastguard Worker %tmp5 = and <4 x i32> %tmp4, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 15*9880d681SAndroid Build Coastguard Worker %tmp6 = or <4 x i32> %tmp5, <i32 1056964608, i32 1056964608, i32 1056964608, i32 1056964608> 16*9880d681SAndroid Build Coastguard Worker %tmp7 = bitcast <4 x i32> %tmp6 to <4 x float> 17*9880d681SAndroid Build Coastguard Worker %tmp8 = fadd <4 x float> %tmp3, %tmp7 18*9880d681SAndroid Build Coastguard Worker %tmp9 = tail call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %tmp8) #2 19*9880d681SAndroid Build Coastguard Worker %tmp10 = bitcast <4 x i32> %tmp9 to <2 x i64> 20*9880d681SAndroid Build Coastguard Worker %tmp11 = tail call <4 x float> @llvm.x86.sse2.cvtdq2ps(<4 x i32> %tmp9) #2 21*9880d681SAndroid Build Coastguard Worker %tmp12 = fmul <4 x float> %tmp11, <float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000> 22*9880d681SAndroid Build Coastguard Worker %tmp13 = fsub <4 x float> %tmp, %tmp12 23*9880d681SAndroid Build Coastguard Worker %tmp14 = fmul <4 x float> %tmp11, <float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000> 24*9880d681SAndroid Build Coastguard Worker %tmp15 = fsub <4 x float> %tmp13, %tmp14 25*9880d681SAndroid Build Coastguard Worker %tmp16 = fmul <4 x float> %tmp15, %tmp15 26*9880d681SAndroid Build Coastguard Worker %tmp17 = fmul <4 x float> %tmp15, %tmp16 27*9880d681SAndroid Build Coastguard Worker %tmp18 = fmul <4 x float> %tmp16, <float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000> 28*9880d681SAndroid Build Coastguard Worker %tmp19 = fadd <4 x float> %tmp18, <float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000> 29*9880d681SAndroid Build Coastguard Worker %tmp20 = fmul <4 x float> %tmp16, <float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000> 30*9880d681SAndroid Build Coastguard Worker %tmp21 = fadd <4 x float> %tmp20, <float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000> 31*9880d681SAndroid Build Coastguard Worker %tmp22 = fmul <4 x float> %tmp16, %tmp19 32*9880d681SAndroid Build Coastguard Worker %tmp23 = fadd <4 x float> %tmp22, <float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000> 33*9880d681SAndroid Build Coastguard Worker %tmp24 = fmul <4 x float> %tmp16, %tmp21 34*9880d681SAndroid Build Coastguard Worker %tmp25 = fadd <4 x float> %tmp24, <float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000> 35*9880d681SAndroid Build Coastguard Worker %tmp26 = fmul <4 x float> %tmp16, %tmp23 36*9880d681SAndroid Build Coastguard Worker %tmp27 = fadd <4 x float> %tmp26, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> 37*9880d681SAndroid Build Coastguard Worker %tmp28 = fmul <4 x float> %tmp17, %tmp25 38*9880d681SAndroid Build Coastguard Worker %tmp29 = fadd <4 x float> %tmp15, %tmp28 39*9880d681SAndroid Build Coastguard Worker %tmp30 = and <2 x i64> %tmp10, <i64 4294967297, i64 4294967297> 40*9880d681SAndroid Build Coastguard Worker %tmp31 = bitcast <2 x i64> %tmp30 to <4 x i32> 41*9880d681SAndroid Build Coastguard Worker %tmp32 = icmp eq <4 x i32> %tmp31, zeroinitializer 42*9880d681SAndroid Build Coastguard Worker %tmp33 = sext <4 x i1> %tmp32 to <4 x i32> 43*9880d681SAndroid Build Coastguard Worker %tmp34 = bitcast <4 x i32> %tmp33 to <4 x float> 44*9880d681SAndroid Build Coastguard Worker %tmp35 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp27, <4 x float> %tmp29, <4 x float> %tmp34) #2 45*9880d681SAndroid Build Coastguard Worker %tmp36 = and <2 x i64> %tmp10, <i64 8589934594, i64 8589934594> 46*9880d681SAndroid Build Coastguard Worker %tmp37 = bitcast <2 x i64> %tmp36 to <4 x i32> 47*9880d681SAndroid Build Coastguard Worker %tmp38 = icmp eq <4 x i32> %tmp37, zeroinitializer 48*9880d681SAndroid Build Coastguard Worker %tmp39 = sext <4 x i1> %tmp38 to <4 x i32> 49*9880d681SAndroid Build Coastguard Worker %tmp40 = bitcast <4 x float> %tmp35 to <4 x i32> 50*9880d681SAndroid Build Coastguard Worker %tmp41 = xor <4 x i32> %tmp40, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 51*9880d681SAndroid Build Coastguard Worker %tmp42 = bitcast <4 x i32> %tmp41 to <4 x float> 52*9880d681SAndroid Build Coastguard Worker %tmp43 = bitcast <4 x i32> %tmp39 to <4 x float> 53*9880d681SAndroid Build Coastguard Worker %tmp44 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp42, <4 x float> %tmp35, <4 x float> %tmp43) #2 54*9880d681SAndroid Build Coastguard Worker %tmp45 = bitcast <2 x double> %arg1 to <4 x float> 55*9880d681SAndroid Build Coastguard Worker %tmp46 = fmul <4 x float> %tmp45, <float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000> 56*9880d681SAndroid Build Coastguard Worker %tmp47 = bitcast <2 x double> %arg1 to <4 x i32> 57*9880d681SAndroid Build Coastguard Worker %tmp48 = and <4 x i32> %tmp47, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 58*9880d681SAndroid Build Coastguard Worker %tmp49 = or <4 x i32> %tmp48, <i32 1056964608, i32 1056964608, i32 1056964608, i32 1056964608> 59*9880d681SAndroid Build Coastguard Worker %tmp50 = bitcast <4 x i32> %tmp49 to <4 x float> 60*9880d681SAndroid Build Coastguard Worker %tmp51 = fadd <4 x float> %tmp46, %tmp50 61*9880d681SAndroid Build Coastguard Worker %tmp52 = tail call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %tmp51) #2 62*9880d681SAndroid Build Coastguard Worker %tmp53 = bitcast <4 x i32> %tmp52 to <2 x i64> 63*9880d681SAndroid Build Coastguard Worker %tmp54 = tail call <4 x float> @llvm.x86.sse2.cvtdq2ps(<4 x i32> %tmp52) #2 64*9880d681SAndroid Build Coastguard Worker %tmp55 = fmul <4 x float> %tmp54, <float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000> 65*9880d681SAndroid Build Coastguard Worker %tmp56 = fsub <4 x float> %tmp45, %tmp55 66*9880d681SAndroid Build Coastguard Worker %tmp57 = fmul <4 x float> %tmp54, <float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000> 67*9880d681SAndroid Build Coastguard Worker %tmp58 = fsub <4 x float> %tmp56, %tmp57 68*9880d681SAndroid Build Coastguard Worker %tmp59 = fmul <4 x float> %tmp58, %tmp58 69*9880d681SAndroid Build Coastguard Worker %tmp60 = fmul <4 x float> %tmp58, %tmp59 70*9880d681SAndroid Build Coastguard Worker %tmp61 = fmul <4 x float> %tmp59, <float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000> 71*9880d681SAndroid Build Coastguard Worker %tmp62 = fadd <4 x float> %tmp61, <float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000> 72*9880d681SAndroid Build Coastguard Worker %tmp63 = fmul <4 x float> %tmp59, <float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000> 73*9880d681SAndroid Build Coastguard Worker %tmp64 = fadd <4 x float> %tmp63, <float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000> 74*9880d681SAndroid Build Coastguard Worker %tmp65 = fmul <4 x float> %tmp59, %tmp62 75*9880d681SAndroid Build Coastguard Worker %tmp66 = fadd <4 x float> %tmp65, <float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000> 76*9880d681SAndroid Build Coastguard Worker %tmp67 = fmul <4 x float> %tmp59, %tmp64 77*9880d681SAndroid Build Coastguard Worker %tmp68 = fadd <4 x float> %tmp67, <float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000> 78*9880d681SAndroid Build Coastguard Worker %tmp69 = fmul <4 x float> %tmp59, %tmp66 79*9880d681SAndroid Build Coastguard Worker %tmp70 = fadd <4 x float> %tmp69, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> 80*9880d681SAndroid Build Coastguard Worker %tmp71 = fmul <4 x float> %tmp60, %tmp68 81*9880d681SAndroid Build Coastguard Worker %tmp72 = fadd <4 x float> %tmp58, %tmp71 82*9880d681SAndroid Build Coastguard Worker %tmp73 = and <2 x i64> %tmp53, <i64 4294967297, i64 4294967297> 83*9880d681SAndroid Build Coastguard Worker %tmp74 = bitcast <2 x i64> %tmp73 to <4 x i32> 84*9880d681SAndroid Build Coastguard Worker %tmp75 = icmp eq <4 x i32> %tmp74, zeroinitializer 85*9880d681SAndroid Build Coastguard Worker %tmp76 = sext <4 x i1> %tmp75 to <4 x i32> 86*9880d681SAndroid Build Coastguard Worker %tmp77 = bitcast <4 x i32> %tmp76 to <4 x float> 87*9880d681SAndroid Build Coastguard Worker %tmp78 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp70, <4 x float> %tmp72, <4 x float> %tmp77) #2 88*9880d681SAndroid Build Coastguard Worker %tmp79 = and <2 x i64> %tmp53, <i64 8589934594, i64 8589934594> 89*9880d681SAndroid Build Coastguard Worker %tmp80 = bitcast <2 x i64> %tmp79 to <4 x i32> 90*9880d681SAndroid Build Coastguard Worker %tmp81 = icmp eq <4 x i32> %tmp80, zeroinitializer 91*9880d681SAndroid Build Coastguard Worker %tmp82 = sext <4 x i1> %tmp81 to <4 x i32> 92*9880d681SAndroid Build Coastguard Worker %tmp83 = bitcast <4 x float> %tmp78 to <4 x i32> 93*9880d681SAndroid Build Coastguard Worker %tmp84 = xor <4 x i32> %tmp83, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 94*9880d681SAndroid Build Coastguard Worker %tmp85 = bitcast <4 x i32> %tmp84 to <4 x float> 95*9880d681SAndroid Build Coastguard Worker %tmp86 = bitcast <4 x i32> %tmp82 to <4 x float> 96*9880d681SAndroid Build Coastguard Worker %tmp87 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp85, <4 x float> %tmp78, <4 x float> %tmp86) #2 97*9880d681SAndroid Build Coastguard Worker %tmp88 = fadd <4 x float> %tmp44, %tmp87 98*9880d681SAndroid Build Coastguard Worker %tmp89 = bitcast <2 x double> %arg2 to <4 x float> 99*9880d681SAndroid Build Coastguard Worker %tmp90 = fmul <4 x float> %tmp89, <float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000, float 0x3FE45F3060000000> 100*9880d681SAndroid Build Coastguard Worker %tmp91 = bitcast <2 x double> %arg2 to <4 x i32> 101*9880d681SAndroid Build Coastguard Worker %tmp92 = and <4 x i32> %tmp91, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 102*9880d681SAndroid Build Coastguard Worker %tmp93 = or <4 x i32> %tmp92, <i32 1056964608, i32 1056964608, i32 1056964608, i32 1056964608> 103*9880d681SAndroid Build Coastguard Worker %tmp94 = bitcast <4 x i32> %tmp93 to <4 x float> 104*9880d681SAndroid Build Coastguard Worker %tmp95 = fadd <4 x float> %tmp90, %tmp94 105*9880d681SAndroid Build Coastguard Worker %tmp96 = tail call <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float> %tmp95) #2 106*9880d681SAndroid Build Coastguard Worker %tmp97 = bitcast <4 x i32> %tmp96 to <2 x i64> 107*9880d681SAndroid Build Coastguard Worker %tmp98 = tail call <4 x float> @llvm.x86.sse2.cvtdq2ps(<4 x i32> %tmp96) #2 108*9880d681SAndroid Build Coastguard Worker %tmp99 = fmul <4 x float> %tmp98, <float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000, float 0x3FF921FB40000000> 109*9880d681SAndroid Build Coastguard Worker %tmp100 = fsub <4 x float> %tmp89, %tmp99 110*9880d681SAndroid Build Coastguard Worker %tmp101 = fmul <4 x float> %tmp98, <float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000, float 0x3E74442D00000000> 111*9880d681SAndroid Build Coastguard Worker %tmp102 = fsub <4 x float> %tmp100, %tmp101 112*9880d681SAndroid Build Coastguard Worker %tmp103 = fmul <4 x float> %tmp102, %tmp102 113*9880d681SAndroid Build Coastguard Worker %tmp104 = fmul <4 x float> %tmp102, %tmp103 114*9880d681SAndroid Build Coastguard Worker %tmp105 = fmul <4 x float> %tmp103, <float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000, float 0xBF56493260000000> 115*9880d681SAndroid Build Coastguard Worker %tmp106 = fadd <4 x float> %tmp105, <float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000, float 0x3FA55406C0000000> 116*9880d681SAndroid Build Coastguard Worker %tmp107 = fmul <4 x float> %tmp103, <float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000, float 0xBF29918DC0000000> 117*9880d681SAndroid Build Coastguard Worker %tmp108 = fadd <4 x float> %tmp107, <float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000, float 0x3F81106840000000> 118*9880d681SAndroid Build Coastguard Worker %tmp109 = fmul <4 x float> %tmp103, %tmp106 119*9880d681SAndroid Build Coastguard Worker %tmp110 = fadd <4 x float> %tmp109, <float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000, float 0xBFDFFFFBE0000000> 120*9880d681SAndroid Build Coastguard Worker %tmp111 = fmul <4 x float> %tmp103, %tmp108 121*9880d681SAndroid Build Coastguard Worker %tmp112 = fadd <4 x float> %tmp111, <float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000, float 0xBFC5555420000000> 122*9880d681SAndroid Build Coastguard Worker %tmp113 = fmul <4 x float> %tmp103, %tmp110 123*9880d681SAndroid Build Coastguard Worker %tmp114 = fadd <4 x float> %tmp113, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> 124*9880d681SAndroid Build Coastguard Worker %tmp115 = fmul <4 x float> %tmp104, %tmp112 125*9880d681SAndroid Build Coastguard Worker %tmp116 = fadd <4 x float> %tmp102, %tmp115 126*9880d681SAndroid Build Coastguard Worker %tmp117 = and <2 x i64> %tmp97, <i64 4294967297, i64 4294967297> 127*9880d681SAndroid Build Coastguard Worker %tmp118 = bitcast <2 x i64> %tmp117 to <4 x i32> 128*9880d681SAndroid Build Coastguard Worker %tmp119 = icmp eq <4 x i32> %tmp118, zeroinitializer 129*9880d681SAndroid Build Coastguard Worker %tmp120 = sext <4 x i1> %tmp119 to <4 x i32> 130*9880d681SAndroid Build Coastguard Worker %tmp121 = bitcast <4 x i32> %tmp120 to <4 x float> 131*9880d681SAndroid Build Coastguard Worker %tmp122 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp114, <4 x float> %tmp116, <4 x float> %tmp121) #2 132*9880d681SAndroid Build Coastguard Worker %tmp123 = and <2 x i64> %tmp97, <i64 8589934594, i64 8589934594> 133*9880d681SAndroid Build Coastguard Worker %tmp124 = bitcast <2 x i64> %tmp123 to <4 x i32> 134*9880d681SAndroid Build Coastguard Worker %tmp125 = icmp eq <4 x i32> %tmp124, zeroinitializer 135*9880d681SAndroid Build Coastguard Worker %tmp126 = sext <4 x i1> %tmp125 to <4 x i32> 136*9880d681SAndroid Build Coastguard Worker %tmp127 = bitcast <4 x float> %tmp122 to <4 x i32> 137*9880d681SAndroid Build Coastguard Worker %tmp128 = xor <4 x i32> %tmp127, <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648> 138*9880d681SAndroid Build Coastguard Worker %tmp129 = bitcast <4 x i32> %tmp128 to <4 x float> 139*9880d681SAndroid Build Coastguard Worker %tmp130 = bitcast <4 x i32> %tmp126 to <4 x float> 140*9880d681SAndroid Build Coastguard Worker %tmp131 = tail call <4 x float> @llvm.x86.sse41.blendvps(<4 x float> %tmp129, <4 x float> %tmp122, <4 x float> %tmp130) #2 141*9880d681SAndroid Build Coastguard Worker %tmp132 = fadd <4 x float> %tmp88, %tmp131 142*9880d681SAndroid Build Coastguard Worker %tmp133 = bitcast <4 x float> %tmp132 to <2 x double> 143*9880d681SAndroid Build Coastguard Worker ret <2 x double> %tmp133 144*9880d681SAndroid Build Coastguard Worker} 145*9880d681SAndroid Build Coastguard Worker 146*9880d681SAndroid Build Coastguard Workerdeclare <4 x i32> @llvm.x86.sse2.cvttps2dq(<4 x float>) 147*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse2.cvtdq2ps(<4 x i32>) 148*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.x86.sse41.blendvps(<4 x float>, <4 x float>, <4 x float>) 149