1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc < %s | FileCheck %s 3; Calls to abort should all be merged 4 5; ModuleID = '5898899.c' 6target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128" 7target triple = "x86_64-apple-darwin8" 8 %struct.BoundaryAlignment = type { [3 x i8], i8, i16, i16, i8, [2 x i8] } 9 10define void @passing2(i64 %str.0, i64 %str.1, i16 signext %s, i32 %j, i8 signext %c, i16 signext %t, i16 signext %u, i8 signext %d) nounwind optsize { 11; CHECK-LABEL: passing2: 12; CHECK: ## %bb.0: ## %entry 13; CHECK-NEXT: subq $40, %rsp 14; CHECK-NEXT: movq %rsi, %rax 15; CHECK-NEXT: movq %rdi, {{[0-9]+}}(%rsp) 16; CHECK-NEXT: movb %al, {{[0-9]+}}(%rsp) 17; CHECK-NEXT: movb %ah, {{[0-9]+}}(%rsp) 18; CHECK-NEXT: shrq $16, %rsi 19; CHECK-NEXT: movb %sil, {{[0-9]+}}(%rsp) 20; CHECK-NEXT: shrq $24, %rax 21; CHECK-NEXT: movb %al, {{[0-9]+}}(%rsp) 22; CHECK-NEXT: movw %dx, {{[0-9]+}}(%rsp) 23; CHECK-NEXT: movl %ecx, {{[0-9]+}}(%rsp) 24; CHECK-NEXT: movb %r8b, {{[0-9]+}}(%rsp) 25; CHECK-NEXT: movw %r9w, {{[0-9]+}}(%rsp) 26; CHECK-NEXT: shll $14, %edi 27; CHECK-NEXT: sarl $23, %edi 28; CHECK-NEXT: cmpl %ecx, %edi 29; CHECK-NEXT: jne LBB0_6 30; CHECK-NEXT: ## %bb.1: ## %bb27 31; CHECK-NEXT: movb {{[0-9]+}}(%rsp), %al 32; CHECK-NEXT: cmpb {{[0-9]+}}(%rsp), %al 33; CHECK-NEXT: jne LBB0_6 34; CHECK-NEXT: ## %bb.2: ## %bb35 35; CHECK-NEXT: movl {{[0-9]+}}(%rsp), %eax 36; CHECK-NEXT: shll $7, %eax 37; CHECK-NEXT: cwtl 38; CHECK-NEXT: shrl $7, %eax 39; CHECK-NEXT: cmpw {{[0-9]+}}(%rsp), %ax 40; CHECK-NEXT: jne LBB0_6 41; CHECK-NEXT: ## %bb.3: ## %bb51 42; CHECK-NEXT: movl {{[0-9]+}}(%rsp), %eax 43; CHECK-NEXT: shll $7, %eax 44; CHECK-NEXT: cwtl 45; CHECK-NEXT: shrl $7, %eax 46; CHECK-NEXT: cmpw {{[0-9]+}}(%rsp), %ax 47; CHECK-NEXT: jne LBB0_6 48; CHECK-NEXT: ## %bb.4: ## %bb67 49; CHECK-NEXT: movb {{[0-9]+}}(%rsp), %al 50; CHECK-NEXT: cmpb {{[0-9]+}}(%rsp), %al 51; CHECK-NEXT: jne LBB0_6 52; CHECK-NEXT: ## %bb.5: ## %bb75 53; CHECK-NEXT: addq $40, %rsp 54; CHECK-NEXT: retq 55; CHECK-NEXT: LBB0_6: ## %bb 56; CHECK-NEXT: xorl %eax, %eax 57; CHECK-NEXT: callq _abort 58entry: 59 %str_addr = alloca %struct.BoundaryAlignment ; <%struct.BoundaryAlignment*> [#uses=7] 60 %s_addr = alloca i16 ; <i16*> [#uses=1] 61 %j_addr = alloca i32 ; <i32*> [#uses=2] 62 %c_addr = alloca i8 ; <i8*> [#uses=2] 63 %t_addr = alloca i16 ; <i16*> [#uses=2] 64 %u_addr = alloca i16 ; <i16*> [#uses=2] 65 %d_addr = alloca i8 ; <i8*> [#uses=2] 66 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0] 67 %tmp = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1] 68 %tmp1 = getelementptr { i64, i64 }, { i64, i64 }* %tmp, i32 0, i32 0 ; <i64*> [#uses=1] 69 store i64 %str.0, i64* %tmp1 70 %tmp2 = bitcast %struct.BoundaryAlignment* %str_addr to { i64, i64 }* ; <{ i64, i64 }*> [#uses=1] 71 %tmp3 = getelementptr { i64, i64 }, { i64, i64 }* %tmp2, i32 0, i32 1 ; <i64*> [#uses=1] 72 %bc = bitcast i64* %tmp3 to i8* ; <i8*> [#uses=2] 73 %byte = trunc i64 %str.1 to i8 ; <i8> [#uses=1] 74 store i8 %byte, i8* %bc 75 %shft = lshr i64 %str.1, 8 ; <i64> [#uses=2] 76 %Loc = getelementptr i8, i8* %bc, i32 1 ; <i8*> [#uses=2] 77 %byte4 = trunc i64 %shft to i8 ; <i8> [#uses=1] 78 store i8 %byte4, i8* %Loc 79 %shft5 = lshr i64 %shft, 8 ; <i64> [#uses=2] 80 %Loc6 = getelementptr i8, i8* %Loc, i32 1 ; <i8*> [#uses=2] 81 %byte7 = trunc i64 %shft5 to i8 ; <i8> [#uses=1] 82 store i8 %byte7, i8* %Loc6 83 %shft8 = lshr i64 %shft5, 8 ; <i64> [#uses=2] 84 %Loc9 = getelementptr i8, i8* %Loc6, i32 1 ; <i8*> [#uses=2] 85 %byte10 = trunc i64 %shft8 to i8 ; <i8> [#uses=1] 86 store i8 %byte10, i8* %Loc9 87 %shft11 = lshr i64 %shft8, 8 ; <i64> [#uses=0] 88 %Loc12 = getelementptr i8, i8* %Loc9, i32 1 ; <i8*> [#uses=0] 89 store i16 %s, i16* %s_addr 90 store i32 %j, i32* %j_addr 91 store i8 %c, i8* %c_addr 92 store i16 %t, i16* %t_addr 93 store i16 %u, i16* %u_addr 94 store i8 %d, i8* %d_addr 95 %tmp13 = getelementptr %struct.BoundaryAlignment, %struct.BoundaryAlignment* %str_addr, i32 0, i32 0 ; <[3 x i8]*> [#uses=1] 96 %tmp1314 = bitcast [3 x i8]* %tmp13 to i32* ; <i32*> [#uses=1] 97 %tmp15 = load i32, i32* %tmp1314, align 4 ; <i32> [#uses=1] 98 %tmp16 = shl i32 %tmp15, 14 ; <i32> [#uses=1] 99 %tmp17 = ashr i32 %tmp16, 23 ; <i32> [#uses=1] 100 %tmp1718 = trunc i32 %tmp17 to i16 ; <i16> [#uses=1] 101 %sextl = shl i16 %tmp1718, 7 ; <i16> [#uses=1] 102 %sextr = ashr i16 %sextl, 7 ; <i16> [#uses=2] 103 %sextl19 = shl i16 %sextr, 7 ; <i16> [#uses=1] 104 %sextr20 = ashr i16 %sextl19, 7 ; <i16> [#uses=0] 105 %sextl21 = shl i16 %sextr, 7 ; <i16> [#uses=1] 106 %sextr22 = ashr i16 %sextl21, 7 ; <i16> [#uses=1] 107 %sextr2223 = sext i16 %sextr22 to i32 ; <i32> [#uses=1] 108 %tmp24 = load i32, i32* %j_addr, align 4 ; <i32> [#uses=1] 109 %tmp25 = icmp ne i32 %sextr2223, %tmp24 ; <i1> [#uses=1] 110 %tmp2526 = zext i1 %tmp25 to i8 ; <i8> [#uses=1] 111 %toBool = icmp ne i8 %tmp2526, 0 ; <i1> [#uses=1] 112 br i1 %toBool, label %bb, label %bb27 113 114bb: ; preds = %entry 115 call void (...) @abort( ) noreturn nounwind 116 unreachable 117 118bb27: ; preds = %entry 119 %tmp28 = getelementptr %struct.BoundaryAlignment, %struct.BoundaryAlignment* %str_addr, i32 0, i32 1 ; <i8*> [#uses=1] 120 %tmp29 = load i8, i8* %tmp28, align 4 ; <i8> [#uses=1] 121 %tmp30 = load i8, i8* %c_addr, align 1 ; <i8> [#uses=1] 122 %tmp31 = icmp ne i8 %tmp29, %tmp30 ; <i1> [#uses=1] 123 %tmp3132 = zext i1 %tmp31 to i8 ; <i8> [#uses=1] 124 %toBool33 = icmp ne i8 %tmp3132, 0 ; <i1> [#uses=1] 125 br i1 %toBool33, label %bb34, label %bb35 126 127bb34: ; preds = %bb27 128 call void (...) @abort( ) noreturn nounwind 129 unreachable 130 131bb35: ; preds = %bb27 132 %tmp36 = getelementptr %struct.BoundaryAlignment, %struct.BoundaryAlignment* %str_addr, i32 0, i32 2 ; <i16*> [#uses=1] 133 %tmp37 = load i16, i16* %tmp36, align 4 ; <i16> [#uses=1] 134 %tmp38 = shl i16 %tmp37, 7 ; <i16> [#uses=1] 135 %tmp39 = ashr i16 %tmp38, 7 ; <i16> [#uses=1] 136 %sextl40 = shl i16 %tmp39, 7 ; <i16> [#uses=1] 137 %sextr41 = ashr i16 %sextl40, 7 ; <i16> [#uses=2] 138 %sextl42 = shl i16 %sextr41, 7 ; <i16> [#uses=1] 139 %sextr43 = ashr i16 %sextl42, 7 ; <i16> [#uses=0] 140 %sextl44 = shl i16 %sextr41, 7 ; <i16> [#uses=1] 141 %sextr45 = ashr i16 %sextl44, 7 ; <i16> [#uses=1] 142 %tmp46 = load i16, i16* %t_addr, align 2 ; <i16> [#uses=1] 143 %tmp47 = icmp ne i16 %sextr45, %tmp46 ; <i1> [#uses=1] 144 %tmp4748 = zext i1 %tmp47 to i8 ; <i8> [#uses=1] 145 %toBool49 = icmp ne i8 %tmp4748, 0 ; <i1> [#uses=1] 146 br i1 %toBool49, label %bb50, label %bb51 147 148bb50: ; preds = %bb35 149 call void (...) @abort( ) noreturn nounwind 150 unreachable 151 152bb51: ; preds = %bb35 153 %tmp52 = getelementptr %struct.BoundaryAlignment, %struct.BoundaryAlignment* %str_addr, i32 0, i32 3 ; <i16*> [#uses=1] 154 %tmp53 = load i16, i16* %tmp52, align 4 ; <i16> [#uses=1] 155 %tmp54 = shl i16 %tmp53, 7 ; <i16> [#uses=1] 156 %tmp55 = ashr i16 %tmp54, 7 ; <i16> [#uses=1] 157 %sextl56 = shl i16 %tmp55, 7 ; <i16> [#uses=1] 158 %sextr57 = ashr i16 %sextl56, 7 ; <i16> [#uses=2] 159 %sextl58 = shl i16 %sextr57, 7 ; <i16> [#uses=1] 160 %sextr59 = ashr i16 %sextl58, 7 ; <i16> [#uses=0] 161 %sextl60 = shl i16 %sextr57, 7 ; <i16> [#uses=1] 162 %sextr61 = ashr i16 %sextl60, 7 ; <i16> [#uses=1] 163 %tmp62 = load i16, i16* %u_addr, align 2 ; <i16> [#uses=1] 164 %tmp63 = icmp ne i16 %sextr61, %tmp62 ; <i1> [#uses=1] 165 %tmp6364 = zext i1 %tmp63 to i8 ; <i8> [#uses=1] 166 %toBool65 = icmp ne i8 %tmp6364, 0 ; <i1> [#uses=1] 167 br i1 %toBool65, label %bb66, label %bb67 168 169bb66: ; preds = %bb51 170 call void (...) @abort( ) noreturn nounwind 171 unreachable 172 173bb67: ; preds = %bb51 174 %tmp68 = getelementptr %struct.BoundaryAlignment, %struct.BoundaryAlignment* %str_addr, i32 0, i32 4 ; <i8*> [#uses=1] 175 %tmp69 = load i8, i8* %tmp68, align 4 ; <i8> [#uses=1] 176 %tmp70 = load i8, i8* %d_addr, align 1 ; <i8> [#uses=1] 177 %tmp71 = icmp ne i8 %tmp69, %tmp70 ; <i1> [#uses=1] 178 %tmp7172 = zext i1 %tmp71 to i8 ; <i8> [#uses=1] 179 %toBool73 = icmp ne i8 %tmp7172, 0 ; <i1> [#uses=1] 180 br i1 %toBool73, label %bb74, label %bb75 181 182bb74: ; preds = %bb67 183 call void (...) @abort( ) noreturn nounwind 184 unreachable 185 186bb75: ; preds = %bb67 187 br label %return 188 189return: ; preds = %bb75 190 ret void 191} 192 193declare void @abort(...) noreturn nounwind 194