|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc -mtriple x86_64 < %s | FileCheck %s |
| 3 | + |
| 4 | +; To ensure unused floating point constant is removed in negation |
| 5 | +define float @test(float %src, float* %p) { |
| 6 | +; CHECK-LABEL: test: |
| 7 | +; CHECK: # %bb.0: # %entry |
| 8 | +; CHECK-NEXT: movq $0, (%rdi) |
| 9 | +; CHECK-NEXT: xorps %xmm0, %xmm0 |
| 10 | +; CHECK-NEXT: retq |
| 11 | +entry: |
| 12 | + %a0 = getelementptr inbounds float, float* %p, i32 0 |
| 13 | + %a1 = getelementptr inbounds float, float* %p, i32 1 |
| 14 | + store float 0.000000e+00, float* %a0 |
| 15 | + store float 0.000000e+00, float* %a1 |
| 16 | + %zero = load float, float* %a0 |
| 17 | + %fmul1 = fmul fast float %zero, %src |
| 18 | + %fadd1 = fadd fast float %fmul1, %zero |
| 19 | + %fmul2 = fmul fast float %fadd1, 2.000000e+00 |
| 20 | + %fmul3 = fmul fast float %fmul2, %fmul2 |
| 21 | + %fmul4 = fmul fast float %fmul2, 2.000000e+00 |
| 22 | + %fadd2 = fadd fast float %fmul4, -3.000000e+00 |
| 23 | + %fmul5 = fmul fast float %fadd2, %fmul2 |
| 24 | + %fadd3 = fadd fast float %fmul2, %src |
| 25 | + %fadd4 = fadd fast float %fadd3, %fmul5 |
| 26 | + %fmul6 = fmul fast float %fmul3, %fadd4 |
| 27 | + ret float %fmul6 |
| 28 | +} |
0 commit comments