1*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=x86_64-pc-linux < %s | FileCheck %s 2*9880d681SAndroid Build Coastguard Worker; 3*9880d681SAndroid Build Coastguard Worker; Check that x86's peephole optimization doesn't fold a 64-bit load (movsd) into 4*9880d681SAndroid Build Coastguard Worker; addpd. 5*9880d681SAndroid Build Coastguard Worker; rdar://problem/18236850 6*9880d681SAndroid Build Coastguard Worker 7*9880d681SAndroid Build Coastguard Worker%struct.S1 = type { double, double } 8*9880d681SAndroid Build Coastguard Worker 9*9880d681SAndroid Build Coastguard Worker@g = common global %struct.S1 zeroinitializer, align 8 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Workerdeclare void @foo3(%struct.S1*) 12*9880d681SAndroid Build Coastguard Worker 13*9880d681SAndroid Build Coastguard Worker; CHECK: movsd {{[0-9]*}}(%rsp), [[R0:%xmm[0-9]+]] 14*9880d681SAndroid Build Coastguard Worker; CHECK: addpd [[R0]], %xmm{{[0-9]+}} 15*9880d681SAndroid Build Coastguard Worker 16*9880d681SAndroid Build Coastguard Workerdefine void @foo1(double %a.coerce0, double %a.coerce1, double %b.coerce0, double %b.coerce1) { 17*9880d681SAndroid Build Coastguard Worker %1 = alloca <2 x double>, align 16 18*9880d681SAndroid Build Coastguard Worker %tmpcast = bitcast <2 x double>* %1 to %struct.S1* 19*9880d681SAndroid Build Coastguard Worker call void @foo3(%struct.S1* %tmpcast) #2 20*9880d681SAndroid Build Coastguard Worker %p2 = getelementptr inbounds %struct.S1, %struct.S1* %tmpcast, i64 0, i32 0 21*9880d681SAndroid Build Coastguard Worker %2 = load double, double* %p2, align 16 22*9880d681SAndroid Build Coastguard Worker %p3 = getelementptr inbounds %struct.S1, %struct.S1* %tmpcast, i64 0, i32 1 23*9880d681SAndroid Build Coastguard Worker %3 = load double, double* %p3, align 8 24*9880d681SAndroid Build Coastguard Worker %4 = insertelement <2 x double> undef, double %2, i32 0 25*9880d681SAndroid Build Coastguard Worker %5 = insertelement <2 x double> %4, double 0.000000e+00, i32 1 26*9880d681SAndroid Build Coastguard Worker %6 = insertelement <2 x double> undef, double %3, i32 1 27*9880d681SAndroid Build Coastguard Worker %7 = insertelement <2 x double> %6, double 1.000000e+00, i32 0 28*9880d681SAndroid Build Coastguard Worker %8 = fadd <2 x double> %5, %7 29*9880d681SAndroid Build Coastguard Worker store <2 x double> %8, <2 x double>* bitcast (%struct.S1* @g to <2 x double>*), align 16 30*9880d681SAndroid Build Coastguard Worker ret void 31*9880d681SAndroid Build Coastguard Worker} 32