xref: /llvm-project/llvm/test/CodeGen/AArch64/GlobalISel/combine-constant-fold-fma.mir (revision eaab3245d4a34240cba845229f01c459ece5c0a9)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple aarch64 -run-pass=aarch64-prelegalizer-combiner -verify-machineinstrs %s -o - | FileCheck %s
3
4---
5name:            fma
6liveins:
7  - { reg: '$d0' }
8body:             |
9  bb.1.entry:
10    liveins: $d0
11
12    ; CHECK-LABEL: name: fma
13    ; CHECK: liveins: $d0
14    ; CHECK-NEXT: {{  $}}
15    ; CHECK-NEXT: %res:_(s64) = G_FCONSTANT double 8.100000e+01
16    ; CHECK-NEXT: $d0 = COPY %res(s64)
17    ; CHECK-NEXT: RET_ReallyLR implicit $d0
18    %a:_(s64) = G_FCONSTANT double 40.0
19    %b:_(s64) = G_FCONSTANT double 2.0
20    %c:_(s64) = G_FCONSTANT double 1.0
21    %res:_(s64) = G_FMA %a, %b, %c
22    $d0 = COPY %res(s64)
23    RET_ReallyLR implicit $d0
24
25...
26
27---
28name:            fmad
29liveins:
30  - { reg: '$d0' }
31body:             |
32  bb.1.entry:
33    liveins: $d0
34
35    ; CHECK-LABEL: name: fmad
36    ; CHECK: liveins: $d0
37    ; CHECK-NEXT: {{  $}}
38    ; CHECK-NEXT: %res:_(s64) = G_FCONSTANT double 8.100000e+01
39    ; CHECK-NEXT: $d0 = COPY %res(s64)
40    ; CHECK-NEXT: RET_ReallyLR implicit $d0
41    %a:_(s64) = G_FCONSTANT double 40.0
42    %b:_(s64) = G_FCONSTANT double 2.0
43    %c:_(s64) = G_FCONSTANT double 1.0
44    %res:_(s64) = G_FMAD %a, %b, %c
45    $d0 = COPY %res(s64)
46    RET_ReallyLR implicit $d0
47
48...
49