36 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -verify-machineinstrs -mtriple=powerpc64le-linux-gnu | FileCheck %s3 4define float @can_fma_with_fewer_uses(float %f1, float %f2, float %f3, float %f4) {5; CHECK-LABEL: can_fma_with_fewer_uses:6; CHECK: # %bb.0:7; CHECK-NEXT: xsmulsp 0, 1, 28; CHECK-NEXT: fmr 1, 09; CHECK-NEXT: xsmaddasp 1, 3, 410; CHECK-NEXT: xsdivsp 1, 0, 111; CHECK-NEXT: blr12 %mul1 = fmul contract float %f1, %f213 %mul2 = fmul contract float %f3, %f414 %add = fadd contract float %mul1, %mul215 %second_use_of_mul1 = fdiv float %mul1, %add16 ret float %second_use_of_mul117}18 19; There is no contract on the mul with no extra use so we can't fuse that.20; Since we are fusing with the mul with an extra use, the fmul needs to stick21; around beside the fma.22define float @no_fma_with_fewer_uses(float %f1, float %f2, float %f3, float %f4) {23; CHECK-LABEL: no_fma_with_fewer_uses:24; CHECK: # %bb.0:25; CHECK-NEXT: xsmulsp 3, 3, 426; CHECK-NEXT: xsmulsp 0, 1, 227; CHECK-NEXT: xsmaddasp 3, 1, 228; CHECK-NEXT: xsdivsp 1, 0, 329; CHECK-NEXT: blr30 %mul1 = fmul contract float %f1, %f231 %mul2 = fmul float %f3, %f432 %add = fadd contract float %mul1, %mul233 %second_use_of_mul1 = fdiv float %mul1, %add34 ret float %second_use_of_mul135}36