1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 # RUN: llc -mtriple aarch64 -run-pass=machine-combiner -o - %s | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 @c = global double 0.000000e+00, align 8
9 define void @emit_fneg_with_non_register_operand(double %c) {
11 %0 = load double, ptr @c, align 8
12 %1 = tail call double asm sideeffect "", "=w,0"(double %0)
13 %2 = load double, ptr @c, align 8
14 %3 = tail call double asm sideeffect "", "=w,0"(double %2)
15 %fneg = fneg double %1
16 %cmp = fcmp oeq double %3, %fneg
17 br i1 %cmp, label %if.then, label %if.end
19 if.then: ; preds = %entry
20 tail call void @b(double noundef %1)
23 if.end: ; preds = %entry
27 declare void @b(double noundef)
31 name: emit_fneg_with_non_register_operand
33 exposesReturnsTwice: false
35 regBankSelected: false
38 tracksRegLiveness: true
41 callsUnwindInit: false
47 failsVerification: false
48 tracksDebugUserValues: false
50 - { id: 0, class: fpr64, preferred-register: '' }
51 - { id: 1, class: fpr64, preferred-register: '' }
52 - { id: 2, class: fpr64, preferred-register: '' }
53 - { id: 3, class: fpr64, preferred-register: '' }
54 - { id: 4, class: fpr64, preferred-register: '' }
55 - { id: 5, class: fpr64, preferred-register: '' }
56 - { id: 6, class: gpr64common, preferred-register: '' }
57 - { id: 7, class: fpr64, preferred-register: '' }
60 isFrameAddressTaken: false
61 isReturnAddressTaken: false
72 cvBytesOfCalleeSavedRegisters: 0
73 hasOpaqueSPAdjustment: false
75 hasMustTailInVarArgFunc: false
84 debugValueSubstitutions: []
86 machineFunctionInfo: {}
88 ; CHECK-LABEL: name: emit_fneg_with_non_register_operand
90 ; CHECK-NEXT: successors: %bb.1(0x50000000), %bb.2(0x30000000)
92 ; CHECK-NEXT: [[LOADgot:%[0-9]+]]:gpr64common = LOADgot target-flags(aarch64-got) @c
93 ; CHECK-NEXT: [[LDRDui:%[0-9]+]]:fpr64 = LDRDui [[LOADgot]], 0 :: (dereferenceable load (s64) from @c)
94 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 3735562 /* regdef:FPR64 */, def %2, 2147483657 /* reguse tiedto:$0 */, [[LDRDui]](tied-def 3)
95 ; CHECK-NEXT: [[COPY:%[0-9]+]]:fpr64 = COPY %2
96 ; CHECK-NEXT: [[LDRDui1:%[0-9]+]]:fpr64 = LDRDui [[LOADgot]], 0 :: (dereferenceable load (s64) from @c)
97 ; CHECK-NEXT: INLINEASM &"", 1 /* sideeffect attdialect */, 3735562 /* regdef:FPR64 */, def %4, 2147483657 /* reguse tiedto:$0 */, [[LDRDui1]](tied-def 3)
98 ; CHECK-NEXT: [[FNEGDr:%[0-9]+]]:fpr64 = FNEGDr %2
99 ; CHECK-NEXT: nofpexcept FCMPDrr %4, killed [[FNEGDr]], implicit-def $nzcv, implicit $fpcr
100 ; CHECK-NEXT: Bcc 1, %bb.2, implicit $nzcv
101 ; CHECK-NEXT: B %bb.1
103 ; CHECK-NEXT: bb.1.if.then:
104 ; CHECK-NEXT: $d0 = COPY [[COPY]]
105 ; CHECK-NEXT: TCRETURNdi @b, 0, csr_aarch64_aapcs, implicit $sp, implicit $d0
107 ; CHECK-NEXT: bb.2.if.end:
108 ; CHECK-NEXT: RET_ReallyLR
110 successors: %bb.1(0x50000000), %bb.2(0x30000000)
112 %6:gpr64common = LOADgot target-flags(aarch64-got) @c
113 %3:fpr64 = LDRDui %6, 0 :: (dereferenceable load (s64) from @c)
114 INLINEASM &"", 1 /* sideeffect attdialect */, 3735562 /* regdef:FPR64 */, def %2, 2147483657 /* reguse tiedto:$0 */, %3(tied-def 3)
116 %5:fpr64 = LDRDui %6, 0 :: (dereferenceable load (s64) from @c)
117 INLINEASM &"", 1 /* sideeffect attdialect */, 3735562 /* regdef:FPR64 */, def %4, 2147483657 /* reguse tiedto:$0 */, %5(tied-def 3)
119 nofpexcept FCMPDrr %4, killed %7, implicit-def $nzcv, implicit $fpcr
120 Bcc 1, %bb.2, implicit $nzcv
125 TCRETURNdi @b, 0, csr_aarch64_aapcs, implicit $sp, implicit $d0