brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · ff93aad Raw
46 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple x86_64 < %s | FileCheck %s3 4; To ensure unused floating point constant is correctly removed5define float @test(float %src, ptr %p) {6; CHECK-LABEL: test:7; CHECK:       # %bb.0: # %entry8; CHECK-NEXT:    movq $0, (%rdi)9; CHECK-NEXT:    xorps %xmm0, %xmm010; CHECK-NEXT:    retq11entry:12  %a1 = getelementptr inbounds float, ptr %p, i32 113  store float 0.000000e+00, ptr %p14  store float 0.000000e+00, ptr %a115  %zero = load float, ptr %p16  %fmul1 = fmul fast float %zero, %src17  %fadd1 = fadd fast float %fmul1, %zero18  %fmul2 = fmul fast float %fadd1, 2.000000e+0019  %fmul3 = fmul fast float %fmul2, %fmul220  %fmul4 = fmul fast float %fmul2, 2.000000e+0021  %fadd2 = fadd fast float %fmul4, -3.000000e+0022  %fmul5 = fmul fast float %fadd2, %fmul223  %fadd3 = fadd fast float %fmul2, %src24  %fadd4 = fadd fast float %fadd3, %fmul525  %fmul6 = fmul fast float %fmul3, %fadd426  ret float %fmul627}28 29; To ensure negated result will not be removed when NegX=NegY and30; NegX is needed31define float @test2(float %x, float %y) {32; CHECK-LABEL: test2:33; CHECK:       # %bb.0:34; CHECK-NEXT:    movaps %xmm1, %xmm035; CHECK-NEXT:    mulss {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm036; CHECK-NEXT:    retq37  %add = fadd fast float %x, 750.038  %sub = fsub fast float %x, %add39  %mul = fmul fast float %sub, %sub40  %mul2 = fmul fast float %mul, %sub41  %add2 = fadd fast float %mul2, 1.042  %add3 = fadd fast float %mul2, %add243  %mul3 = fmul fast float %y, %add344  ret float %mul345}46