1 ; RUN: llc < %s -mtriple=arm64-apple-ios -verify-machineinstrs | FileCheck %s
3 ; LdStOpt bug created illegal instruction:
4 ; %d1, %d2 = LDPSi %x0, 1
8 %struct.CGRect = type { %struct.CGPoint, %struct.CGSize }
9 %struct.CGPoint = type { double, double }
10 %struct.CGSize = type { double, double }
12 @"OBJC_IVAR_$_UIScreen._bounds" = external hidden global i64, section "__DATA, __objc_ivar", align 8
14 define hidden %struct.CGRect @t(%0* nocapture %self, i8* nocapture %_cmd) nounwind readonly optsize ssp {
17 ; CHECK: ldp d{{[0-9]+}}, d{{[0-9]+}}
18 %ivar = load i64, i64* @"OBJC_IVAR_$_UIScreen._bounds", align 8, !invariant.load !4
19 %0 = bitcast %0* %self to i8*
20 %add.ptr = getelementptr inbounds i8, i8* %0, i64 %ivar
21 %add.ptr10.0 = bitcast i8* %add.ptr to double*
22 %tmp11 = load double, double* %add.ptr10.0, align 8
23 %add.ptr.sum = add i64 %ivar, 8
24 %add.ptr10.1 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum
25 %1 = bitcast i8* %add.ptr10.1 to double*
26 %tmp12 = load double, double* %1, align 8
27 %add.ptr.sum17 = add i64 %ivar, 16
28 %add.ptr4.1 = getelementptr inbounds i8, i8* %0, i64 %add.ptr.sum17
29 %add.ptr4.1.0 = bitcast i8* %add.ptr4.1 to double*
30 %tmp = load double, double* %add.ptr4.1.0, align 8
31 %add.ptr4.1.sum = add i64 %ivar, 24
32 %add.ptr4.1.1 = getelementptr inbounds i8, i8* %0, i64 %add.ptr4.1.sum
33 %2 = bitcast i8* %add.ptr4.1.1 to double*
34 %tmp5 = load double, double* %2, align 8
35 %insert14 = insertvalue %struct.CGPoint undef, double %tmp11, 0
36 %insert16 = insertvalue %struct.CGPoint %insert14, double %tmp12, 1
37 %insert = insertvalue %struct.CGRect undef, %struct.CGPoint %insert16, 0
38 %insert7 = insertvalue %struct.CGSize undef, double %tmp, 0
39 %insert9 = insertvalue %struct.CGSize %insert7, double %tmp5, 1
40 %insert3 = insertvalue %struct.CGRect %insert, %struct.CGSize %insert9, 1
41 ret %struct.CGRect %insert3
44 !llvm.module.flags = !{!0, !1, !2, !3}
46 !0 = !{i32 1, !"Objective-C Version", i32 2}
47 !1 = !{i32 1, !"Objective-C Image Info Version", i32 0}
48 !2 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
49 !3 = !{i32 4, !"Objective-C Garbage Collection", i32 0}