xref: /aosp_15_r20/external/llvm/test/CodeGen/ARM/fast-isel-vaddd.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc %s -o - -verify-machineinstrs -fast-isel=true -mattr=+vfp4 -mattr=+neon | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-p:32:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
4*9880d681SAndroid Build Coastguard Workertarget triple = "thumbv7s-apple-ios8.0.0"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker%union.DV = type { <2 x double> }
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard Worker; Fast-ISel was incorrectly trying to codegen <2 x double> adds and returning only a single vadds
9*9880d681SAndroid Build Coastguard Worker; Check that we generate the 2 vaddd's we expect
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard Worker; CHECK: vadd.f64
12*9880d681SAndroid Build Coastguard Worker; CHECK: vadd.f64
13*9880d681SAndroid Build Coastguard Worker
14*9880d681SAndroid Build Coastguard Workerdefine i32 @main(i32 %argc, i8** nocapture readnone %Argv, <2 x double> %tmp31) {
15*9880d681SAndroid Build Coastguard Workerbb:
16*9880d681SAndroid Build Coastguard Worker  %Ad = alloca %union.DV, align 16
17*9880d681SAndroid Build Coastguard Worker  %tmp32 = getelementptr inbounds %union.DV, %union.DV* %Ad, i32 0, i32 0
18*9880d681SAndroid Build Coastguard Worker  %tmp33 = fadd <2 x double> %tmp31, %tmp31
19*9880d681SAndroid Build Coastguard Worker  br label %bb37
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerbb37:                                             ; preds = %bb37, %bb
22*9880d681SAndroid Build Coastguard Worker  %i.02 = phi i32 [ 0, %bb ], [ %tmp38, %bb37 ]
23*9880d681SAndroid Build Coastguard Worker  store <2 x double> %tmp33, <2 x double>* %tmp32, align 16
24*9880d681SAndroid Build Coastguard Worker  %tmp38 = add nuw nsw i32 %i.02, 1
25*9880d681SAndroid Build Coastguard Worker  %exitcond = icmp eq i32 %tmp38, 500000
26*9880d681SAndroid Build Coastguard Worker  br i1 %exitcond, label %bb39, label %bb37
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerbb39:                                             ; preds = %bb37
29*9880d681SAndroid Build Coastguard Worker  call fastcc void @printDV(%union.DV* %Ad)
30*9880d681SAndroid Build Coastguard Worker  ret i32 0
31*9880d681SAndroid Build Coastguard Worker}
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Workerdeclare hidden fastcc void @printDV(%union.DV* nocapture readonly)
34