210 lines · plain
1; RUN: llc < %s -mtriple aarch64 -verify-machineinstrs | FileCheck %s2; RUN: llc < %s -mtriple aarch64 -mattr=+strict-align -verify-machineinstrs | FileCheck %s -check-prefix=CHECK-STRICT3 4; CHECK-LABEL: Strh_zero5; CHECK: str wzr6; CHECK-STRICT-LABEL: Strh_zero7; CHECK-STRICT: strh wzr8; CHECK-STRICT: strh wzr9define void @Strh_zero(ptr nocapture %P, i32 %n) {10entry:11 %idxprom = sext i32 %n to i6412 %arrayidx = getelementptr inbounds i16, ptr %P, i64 %idxprom13 store i16 0, ptr %arrayidx14 %add = add nsw i32 %n, 115 %idxprom1 = sext i32 %add to i6416 %arrayidx2 = getelementptr inbounds i16, ptr %P, i64 %idxprom117 store i16 0, ptr %arrayidx218 ret void19}20 21; CHECK-LABEL: Strh_zero_422; CHECK: str xzr23; CHECK-STRICT-LABEL: Strh_zero_424; CHECK-STRICT: strh wzr25; CHECK-STRICT: strh wzr26; CHECK-STRICT: strh wzr27; CHECK-STRICT: strh wzr28define void @Strh_zero_4(ptr nocapture %P, i32 %n) {29entry:30 %idxprom = sext i32 %n to i6431 %arrayidx = getelementptr inbounds i16, ptr %P, i64 %idxprom32 store i16 0, ptr %arrayidx33 %add = add nsw i32 %n, 134 %idxprom1 = sext i32 %add to i6435 %arrayidx2 = getelementptr inbounds i16, ptr %P, i64 %idxprom136 store i16 0, ptr %arrayidx237 %add3 = add nsw i32 %n, 238 %idxprom4 = sext i32 %add3 to i6439 %arrayidx5 = getelementptr inbounds i16, ptr %P, i64 %idxprom440 store i16 0, ptr %arrayidx541 %add6 = add nsw i32 %n, 342 %idxprom7 = sext i32 %add6 to i6443 %arrayidx8 = getelementptr inbounds i16, ptr %P, i64 %idxprom744 store i16 0, ptr %arrayidx845 ret void46}47 48; CHECK-LABEL: Strw_zero49; CHECK: str xzr50; CHECK-STRICT-LABEL: Strw_zero51; CHECK-STRICT: stp wzr, wzr52define void @Strw_zero(ptr nocapture %P, i32 %n) {53entry:54 %idxprom = sext i32 %n to i6455 %arrayidx = getelementptr inbounds i32, ptr %P, i64 %idxprom56 store i32 0, ptr %arrayidx57 %add = add nsw i32 %n, 158 %idxprom1 = sext i32 %add to i6459 %arrayidx2 = getelementptr inbounds i32, ptr %P, i64 %idxprom160 store i32 0, ptr %arrayidx261 ret void62}63 64; CHECK-LABEL: Strw_zero_nonzero65; CHECK: stp wzr, w166define void @Strw_zero_nonzero(ptr nocapture %P, i32 %n) {67entry:68 %idxprom = sext i32 %n to i6469 %arrayidx = getelementptr inbounds i32, ptr %P, i64 %idxprom70 store i32 0, ptr %arrayidx71 %add = add nsw i32 %n, 172 %idxprom1 = sext i32 %add to i6473 %arrayidx2 = getelementptr inbounds i32, ptr %P, i64 %idxprom174 store i32 %n, ptr %arrayidx275 ret void76}77 78; CHECK-LABEL: Strw_zero_479; CHECK: stp xzr, xzr80; CHECK-STRICT-LABEL: Strw_zero_481; CHECK-STRICT: stp wzr, wzr82; CHECK-STRICT: stp wzr, wzr83define void @Strw_zero_4(ptr nocapture %P, i32 %n) {84entry:85 %idxprom = sext i32 %n to i6486 %arrayidx = getelementptr inbounds i32, ptr %P, i64 %idxprom87 store i32 0, ptr %arrayidx88 %add = add nsw i32 %n, 189 %idxprom1 = sext i32 %add to i6490 %arrayidx2 = getelementptr inbounds i32, ptr %P, i64 %idxprom191 store i32 0, ptr %arrayidx292 %add3 = add nsw i32 %n, 293 %idxprom4 = sext i32 %add3 to i6494 %arrayidx5 = getelementptr inbounds i32, ptr %P, i64 %idxprom495 store i32 0, ptr %arrayidx596 %add6 = add nsw i32 %n, 397 %idxprom7 = sext i32 %add6 to i6498 %arrayidx8 = getelementptr inbounds i32, ptr %P, i64 %idxprom799 store i32 0, ptr %arrayidx8100 ret void101}102 103; CHECK-LABEL: Sturb_zero104; CHECK: sturh wzr105; CHECK-STRICT-LABEL: Sturb_zero106; CHECK-STRICT: sturb wzr107; CHECK-STRICT: sturb wzr108define void @Sturb_zero(ptr nocapture %P, i32 %n) #0 {109entry:110 %sub = add nsw i32 %n, -2111 %idxprom = sext i32 %sub to i64112 %arrayidx = getelementptr inbounds i8, ptr %P, i64 %idxprom113 store i8 0, ptr %arrayidx114 %sub2= add nsw i32 %n, -1115 %idxprom1 = sext i32 %sub2 to i64116 %arrayidx2 = getelementptr inbounds i8, ptr %P, i64 %idxprom1117 store i8 0, ptr %arrayidx2118 ret void119}120 121; CHECK-LABEL: Sturh_zero122; CHECK: stur wzr123; CHECK-STRICT-LABEL: Sturh_zero124; CHECK-STRICT: sturh wzr125; CHECK-STRICT: sturh wzr126define void @Sturh_zero(ptr nocapture %P, i32 %n) {127entry:128 %sub = add nsw i32 %n, -2129 %idxprom = sext i32 %sub to i64130 %arrayidx = getelementptr inbounds i16, ptr %P, i64 %idxprom131 store i16 0, ptr %arrayidx132 %sub1 = add nsw i32 %n, -3133 %idxprom2 = sext i32 %sub1 to i64134 %arrayidx3 = getelementptr inbounds i16, ptr %P, i64 %idxprom2135 store i16 0, ptr %arrayidx3136 ret void137}138 139; CHECK-LABEL: Sturh_zero_4140; CHECK: stur xzr141; CHECK-STRICT-LABEL: Sturh_zero_4142; CHECK-STRICT: sturh wzr143; CHECK-STRICT: sturh wzr144; CHECK-STRICT: sturh wzr145; CHECK-STRICT: sturh wzr146define void @Sturh_zero_4(ptr nocapture %P, i32 %n) {147entry:148 %sub = add nsw i32 %n, -3149 %idxprom = sext i32 %sub to i64150 %arrayidx = getelementptr inbounds i16, ptr %P, i64 %idxprom151 store i16 0, ptr %arrayidx152 %sub1 = add nsw i32 %n, -4153 %idxprom2 = sext i32 %sub1 to i64154 %arrayidx3 = getelementptr inbounds i16, ptr %P, i64 %idxprom2155 store i16 0, ptr %arrayidx3156 %sub4 = add nsw i32 %n, -2157 %idxprom5 = sext i32 %sub4 to i64158 %arrayidx6 = getelementptr inbounds i16, ptr %P, i64 %idxprom5159 store i16 0, ptr %arrayidx6160 %sub7 = add nsw i32 %n, -1161 %idxprom8 = sext i32 %sub7 to i64162 %arrayidx9 = getelementptr inbounds i16, ptr %P, i64 %idxprom8163 store i16 0, ptr %arrayidx9164 ret void165}166 167; CHECK-LABEL: Sturw_zero168; CHECK: stur xzr169; CHECK-STRICT-LABEL: Sturw_zero170; CHECK-STRICT: stp wzr, wzr171define void @Sturw_zero(ptr nocapture %P, i32 %n) {172entry:173 %sub = add nsw i32 %n, -3174 %idxprom = sext i32 %sub to i64175 %arrayidx = getelementptr inbounds i32, ptr %P, i64 %idxprom176 store i32 0, ptr %arrayidx177 %sub1 = add nsw i32 %n, -4178 %idxprom2 = sext i32 %sub1 to i64179 %arrayidx3 = getelementptr inbounds i32, ptr %P, i64 %idxprom2180 store i32 0, ptr %arrayidx3181 ret void182}183 184; CHECK-LABEL: Sturw_zero_4185; CHECK: stp xzr, xzr186; CHECK-STRICT-LABEL: Sturw_zero_4187; CHECK-STRICT: stp wzr, wzr188; CHECK-STRICT: stp wzr, wzr189define void @Sturw_zero_4(ptr nocapture %P, i32 %n) {190entry:191 %sub = add nsw i32 %n, -3192 %idxprom = sext i32 %sub to i64193 %arrayidx = getelementptr inbounds i32, ptr %P, i64 %idxprom194 store i32 0, ptr %arrayidx195 %sub1 = add nsw i32 %n, -4196 %idxprom2 = sext i32 %sub1 to i64197 %arrayidx3 = getelementptr inbounds i32, ptr %P, i64 %idxprom2198 store i32 0, ptr %arrayidx3199 %sub4 = add nsw i32 %n, -2200 %idxprom5 = sext i32 %sub4 to i64201 %arrayidx6 = getelementptr inbounds i32, ptr %P, i64 %idxprom5202 store i32 0, ptr %arrayidx6203 %sub7 = add nsw i32 %n, -1204 %idxprom8 = sext i32 %sub7 to i64205 %arrayidx9 = getelementptr inbounds i32, ptr %P, i64 %idxprom8206 store i32 0, ptr %arrayidx9207 ret void208}209 210