diff options
Diffstat (limited to 'test/CodeGen/X86/codegen-prepare-addrmode-sext.ll')
-rw-r--r-- | test/CodeGen/X86/codegen-prepare-addrmode-sext.ll | 162 |
1 files changed, 80 insertions, 82 deletions
diff --git a/test/CodeGen/X86/codegen-prepare-addrmode-sext.ll b/test/CodeGen/X86/codegen-prepare-addrmode-sext.ll index 85bfff2..f00c40b 100644 --- a/test/CodeGen/X86/codegen-prepare-addrmode-sext.ll +++ b/test/CodeGen/X86/codegen-prepare-addrmode-sext.ll @@ -20,7 +20,7 @@ define i8 @twoArgsPromotion(i32 %arg1, i32 %arg2) { %add = add nsw i32 %arg1, %arg2 %sextadd = sext i32 %add to i64 %base = inttoptr i64 %sextadd to i8* - %res = load i8* %base + %res = load i8, i8* %base ret i8 %res } @@ -35,8 +35,8 @@ define i8 @twoArgsPromotion(i32 %arg1, i32 %arg2) { define i8 @twoArgsNoPromotion(i32 %arg1, i32 %arg2, i8* %base) { %add = add nsw i32 %arg1, %arg2 %sextadd = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -48,8 +48,8 @@ define i8 @twoArgsNoPromotion(i32 %arg1, i32 %arg2, i8* %base) { define i8 @noPromotion(i32 %arg1, i32 %arg2, i8* %base) { %add = add i32 %arg1, %arg2 %sextadd = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -57,13 +57,13 @@ define i8 @noPromotion(i32 %arg1, i32 %arg2, i8* %base) { ; CHECK-LABEL: @oneArgPromotion ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i32 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotion(i32 %arg1, i8* %base) { %add = add nsw i32 %arg1, 1 %sextadd = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -71,14 +71,14 @@ define i8 @oneArgPromotion(i32 %arg1, i8* %base) { ; CHECK-LABEL: @oneArgPromotionZExt ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1ZEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionZExt(i8 %arg1, i8* %base) { %zext = zext i8 %arg1 to i32 %add = add nsw i32 %zext, 1 %sextadd = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -90,17 +90,15 @@ define i8 @oneArgPromotionZExt(i8 %arg1, i8* %base) { ; rolled back. ; Still, this test case exercises the desired code path. ; CHECK-LABEL: @oneArgPromotionCstZExt -; CHECK: [[ZEXT:%[a-zA-Z_0-9-]+]] = zext i16 undef to i32 -; CHECK: [[SEXT:%[a-zA-Z_0-9-]+]] = sext i32 [[ZEXT]] to i64 -; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[SEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 0, 1 +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionCstZExt(i8* %base) { %cst = zext i16 undef to i32 %add = add nsw i32 %cst, 1 %sextadd = sext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -110,14 +108,14 @@ define i8 @oneArgPromotionCstZExt(i8* %base) { ; CHECK: [[ARG1TRUNC:%[a-zA-Z_0-9-]+]] = trunc i32 %arg1 to i8 ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i8 [[ARG1TRUNC]] to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionBlockTrunc1(i32 %arg1, i8* %base) { %trunc = trunc i32 %arg1 to i8 %add = add nsw i8 %trunc, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -128,15 +126,15 @@ define i8 @oneArgPromotionBlockTrunc1(i32 %arg1, i8* %base) { ; CHECK: [[ARG1TRUNC:%[a-zA-Z_0-9-]+]] = trunc i32 [[ARG1SEXT]] to i8 ; CHECK: [[ARG1SEXT64:%[a-zA-Z_0-9-]+]] = sext i8 [[ARG1TRUNC]] to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT64]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionBlockTrunc2(i16 %arg1, i8* %base) { %sextarg1 = sext i16 %arg1 to i32 %trunc = trunc i32 %sextarg1 to i8 %add = add nsw i8 %trunc, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -145,15 +143,15 @@ define i8 @oneArgPromotionBlockTrunc2(i16 %arg1, i8* %base) { ; CHECK-LABEL: @oneArgPromotionPassTruncKeepSExt ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i1 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionPassTruncKeepSExt(i1 %arg1, i8* %base) { %sextarg1 = sext i1 %arg1 to i32 %trunc = trunc i32 %sextarg1 to i8 %add = add nsw i8 %trunc, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -164,15 +162,15 @@ define i8 @oneArgPromotionPassTruncKeepSExt(i1 %arg1, i8* %base) { ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 ; CHECK: [[TRUNC:%[a-zA-Z_0-9-]+]] = trunc i64 [[PROMOTED]] to i8 -; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8* %base, i64 [[PROMOTED]] -; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8* [[GEP]] +; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] +; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8, i8* [[GEP]] ; CHECK: add i8 [[LOAD]], [[TRUNC]] ; CHECK: ret define i8 @oneArgPromotionTruncInsert(i8 %arg1, i8* %base) { %add = add nsw i8 %arg1, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx %finalres = add i8 %res, %add ret i8 %finalres } @@ -182,14 +180,14 @@ define i8 @oneArgPromotionTruncInsert(i8 %arg1, i8* %base) { ; CHECK: [[ARG1TRUNC:%[a-zA-Z_0-9-]+]] = trunc i128 %arg1 to i8 ; CHECK: [[ARG1SEXT64:%[a-zA-Z_0-9-]+]] = sext i8 [[ARG1TRUNC]] to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT64]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionLargerType(i128 %arg1, i8* %base) { %trunc = trunc i128 %arg1 to i8 %add = add nsw i8 %trunc, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx %finalres = add i8 %res, %add ret i8 %finalres } @@ -202,16 +200,16 @@ define i8 @oneArgPromotionLargerType(i128 %arg1, i8* %base) { ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 ; CHECK: [[TRUNC:%[a-zA-Z_0-9-]+]] = trunc i64 [[PROMOTED]] to i8 -; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8* %base, i64 [[PROMOTED]] -; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8* [[GEP]] +; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] +; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8, i8* [[GEP]] ; CHECK: [[ADDRES:%[a-zA-Z_0-9-]+]] = add i8 [[LOAD]], [[TRUNC]] ; CHECK: add i8 [[ADDRES]], [[TRUNC]] ; CHECK: ret define i8 @oneArgPromotionTruncInsertSeveralUse(i8 %arg1, i8* %base) { %add = add nsw i8 %arg1, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx %almostfinalres = add i8 %res, %add %finalres = add i8 %almostfinalres, %add ret i8 %finalres @@ -222,16 +220,16 @@ define i8 @oneArgPromotionTruncInsertSeveralUse(i8 %arg1, i8* %base) { ; CHECK-LABEL: @oneArgPromotionSExtSeveralUse ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nsw i64 [[ARG1SEXT]], 1 -; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8* %base, i64 [[PROMOTED]] -; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8* [[GEP]] +; CHECK: [[GEP:%[a-zA-Z_0-9-]+]] = getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] +; CHECK: [[LOAD:%[a-zA-Z_0-9-]+]] = load i8, i8* [[GEP]] ; CHECK: [[ADDRES:%[a-zA-Z_0-9-]+]] = zext i8 [[LOAD]] to i64 ; CHECK: add i64 [[ADDRES]], [[PROMOTED]] ; CHECK: ret define i64 @oneArgPromotionSExtSeveralUse(i8 %arg1, i8* %base) { %add = add nsw i8 %arg1, 1 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx %almostfinalres = zext i8 %res to i64 %finalres = add i64 %almostfinalres, %sextadd ret i64 %finalres @@ -257,14 +255,14 @@ define i64 @oneArgPromotionSExtSeveralUse(i8 %arg1, i8* %base) { ; CHECK: [[ORIG:%[a-zA-Z_0-9-]+]] = add nsw i32 %arg1, %arg2 ; CHECK: [[ADD:%[a-zA-Z_0-9-]+]] = add nsw i32 [[ORIG]], [[ORIG]] ; CHECK: [[SEXT:%[a-zA-Z_0-9-]+]] = sext i32 [[ADD]] to i64 -; CHECK: getelementptr inbounds i8* %base, i64 [[SEXT]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[SEXT]] ; CHECK: ret define i8 @twoArgsPromotionNest(i32 %arg1, i32 %arg2, i8* %base) { %promotableadd1 = add nsw i32 %arg1, %arg2 %promotableadd2 = add nsw i32 %promotableadd1, %promotableadd1 %sextadd = sext i32 %promotableadd2 to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -279,15 +277,15 @@ define i8 @twoArgsPromotionNest(i32 %arg1, i32 %arg2, i8* %base) { ; CHECK: [[TRUNC:%[a-zA-Z_0-9-]+]] = trunc i32 [[SEXTARG1]] to i8 ; CHECK: [[ADD:%[a-zA-Z_0-9-]+]] = add nsw i8 [[TRUNC]], %arg2 ; CHECK: [[SEXT:%[a-zA-Z_0-9-]+]] = sext i8 [[ADD]] to i64 -; CHECK: getelementptr inbounds i8* %base, i64 [[SEXT]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[SEXT]] ; CHECK: ret define i8 @twoArgsNoPromotionRemove(i1 %arg1, i8 %arg2, i8* %base) { %sextarg1 = sext i1 %arg1 to i32 %trunc = trunc i32 %sextarg1 to i8 %add = add nsw i8 %trunc, %arg2 %sextadd = sext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %sextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %sextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -313,11 +311,11 @@ define i8 @twoArgsNoPromotionRemove(i1 %arg1, i8 %arg2, i8* %base) { ; BB then ; CHECK: [[BASE1:%[a-zA-Z_0-9-]+]] = add i64 [[SEXTADD]], 48 ; CHECK: [[ADDR1:%[a-zA-Z_0-9-]+]] = inttoptr i64 [[BASE1]] to i32* -; CHECK: load i32* [[ADDR1]] +; CHECK: load i32, i32* [[ADDR1]] ; BB else ; CHECK: [[BASE2:%[a-zA-Z_0-9-]+]] = add i64 [[SEXTADD]], 48 ; CHECK: [[ADDR2:%[a-zA-Z_0-9-]+]] = inttoptr i64 [[BASE2]] to i32* -; CHECK: load i32* [[ADDR2]] +; CHECK: load i32, i32* [[ADDR2]] ; CHECK: ret ; CHECK-GEP-LABEL: @checkProfitability ; CHECK-GEP-NOT: {{%[a-zA-Z_0-9-]+}} = sext i32 %arg1 to i64 @@ -328,34 +326,34 @@ define i8 @twoArgsNoPromotionRemove(i1 %arg1, i8 %arg2, i8* %base) { ; BB then ; CHECK-GEP: [[BASE1:%[a-zA-Z_0-9-]+]] = inttoptr i64 [[SEXTADD]] to i32* ; CHECK-GEP: [[BCC1:%[a-zA-Z_0-9-]+]] = bitcast i32* [[BASE1]] to i8* -; CHECK-GEP: [[FULL1:%[a-zA-Z_0-9-]+]] = getelementptr i8* [[BCC1]], i64 48 +; CHECK-GEP: [[FULL1:%[a-zA-Z_0-9-]+]] = getelementptr i8, i8* [[BCC1]], i64 48 ; CHECK-GEP: [[ADDR1:%[a-zA-Z_0-9-]+]] = bitcast i8* [[FULL1]] to i32* -; CHECK-GEP: load i32* [[ADDR1]] +; CHECK-GEP: load i32, i32* [[ADDR1]] ; BB else ; CHECK-GEP: [[BASE2:%[a-zA-Z_0-9-]+]] = inttoptr i64 [[SEXTADD]] to i32* ; CHECK-GEP: [[BCC2:%[a-zA-Z_0-9-]+]] = bitcast i32* [[BASE2]] to i8* -; CHECK-GEP: [[FULL2:%[a-zA-Z_0-9-]+]] = getelementptr i8* [[BCC2]], i64 48 +; CHECK-GEP: [[FULL2:%[a-zA-Z_0-9-]+]] = getelementptr i8, i8* [[BCC2]], i64 48 ; CHECK-GEP: [[ADDR2:%[a-zA-Z_0-9-]+]] = bitcast i8* [[FULL2]] to i32* -; CHECK-GEP: load i32* [[ADDR2]] +; CHECK-GEP: load i32, i32* [[ADDR2]] ; CHECK-GEP: ret define i32 @checkProfitability(i32 %arg1, i32 %arg2, i1 %test) { %shl = shl nsw i32 %arg1, 1 %add1 = add nsw i32 %shl, %arg2 %sextidx1 = sext i32 %add1 to i64 %tmpptr = inttoptr i64 %sextidx1 to i32* - %arrayidx1 = getelementptr i32* %tmpptr, i64 12 + %arrayidx1 = getelementptr i32, i32* %tmpptr, i64 12 br i1 %test, label %then, label %else then: - %res1 = load i32* %arrayidx1 + %res1 = load i32, i32* %arrayidx1 br label %end else: - %res2 = load i32* %arrayidx1 + %res2 = load i32, i32* %arrayidx1 br label %end end: %tmp = phi i32 [%res1, %then], [%res2, %else] %res = add i32 %tmp, %add1 %addr = inttoptr i32 %res to i32* - %final = load i32* %addr + %final = load i32, i32* %addr ret i32 %final } @@ -377,10 +375,10 @@ end: ; CHECK-NEXT: [[ADD:%[a-zA-Z_0-9-]+]] = add i64 [[BASE]], [[PROMOTED_CONV]] ; CHECK-NEXT: [[ADDR:%[a-zA-Z_0-9-]+]] = add i64 [[ADD]], 7 ; CHECK-NEXT: [[CAST:%[a-zA-Z_0-9-]+]] = inttoptr i64 [[ADDR]] to i8* -; CHECK-NEXT: load i8* [[CAST]], align 1 +; CHECK-NEXT: load i8, i8* [[CAST]], align 1 define signext i16 @fn3(%struct.dns_packet* nocapture readonly %P) { entry: - %tmp = getelementptr inbounds %struct.dns_packet* %P, i64 0, i32 2 + %tmp = getelementptr inbounds %struct.dns_packet, %struct.dns_packet* %P, i64 0, i32 2 %data.i.i = bitcast %union.anon* %tmp to [0 x i8]* br label %while.body.i.i @@ -388,8 +386,8 @@ while.body.i.i: ; preds = %while.body.i.i, %en %src.addr.0.i.i = phi i16 [ 0, %entry ], [ %inc.i.i, %while.body.i.i ] %inc.i.i = add i16 %src.addr.0.i.i, 1 %idxprom.i.i = sext i16 %src.addr.0.i.i to i64 - %arrayidx.i.i = getelementptr inbounds [0 x i8]* %data.i.i, i64 0, i64 %idxprom.i.i - %tmp1 = load i8* %arrayidx.i.i, align 1 + %arrayidx.i.i = getelementptr inbounds [0 x i8], [0 x i8]* %data.i.i, i64 0, i64 %idxprom.i.i + %tmp1 = load i8, i8* %arrayidx.i.i, align 1 %conv2.i.i = zext i8 %tmp1 to i32 %and.i.i = and i32 %conv2.i.i, 15 store i32 %and.i.i, i32* @a, align 4 @@ -401,8 +399,8 @@ fn1.exit.i: ; preds = %while.body.i.i %conv.i = zext i16 %inc.i.i.lcssa to i32 %sub.i = add nsw i32 %conv.i, -1 %idxprom.i = sext i32 %sub.i to i64 - %arrayidx.i = getelementptr inbounds [0 x i8]* %data.i.i, i64 0, i64 %idxprom.i - %tmp2 = load i8* %arrayidx.i, align 1 + %arrayidx.i = getelementptr inbounds [0 x i8], [0 x i8]* %data.i.i, i64 0, i64 %idxprom.i + %tmp2 = load i8, i8* %arrayidx.i, align 1 %conv2.i = sext i8 %tmp2 to i16 store i16 %conv2.i, i16* @b, align 2 %sub4.i = sub nsw i32 0, %conv.i @@ -411,8 +409,8 @@ fn1.exit.i: ; preds = %while.body.i.i br i1 %cmp.i, label %if.then.i, label %fn2.exit if.then.i: ; preds = %fn1.exit.i - %end.i = getelementptr inbounds %struct.dns_packet* %P, i64 0, i32 1 - %tmp3 = load i32* %end.i, align 4 + %end.i = getelementptr inbounds %struct.dns_packet, %struct.dns_packet* %P, i64 0, i32 1 + %tmp3 = load i32, i32* %end.i, align 4 %sub7.i = add i32 %tmp3, 65535 %conv8.i = trunc i32 %sub7.i to i16 br label %fn2.exit @@ -433,7 +431,7 @@ define i8 @noPromotionFlag(i32 %arg1, i32 %arg2) { %add = add nsw i32 %arg1, %arg2 %zextadd = zext i32 %add to i64 %base = inttoptr i64 %zextadd to i8* - %res = load i8* %base + %res = load i8, i8* %base ret i8 %res } @@ -448,7 +446,7 @@ define i8 @twoArgsPromotionZExt(i32 %arg1, i32 %arg2) { %add = add nuw i32 %arg1, %arg2 %zextadd = zext i32 %add to i64 %base = inttoptr i64 %zextadd to i8* - %res = load i8* %base + %res = load i8, i8* %base ret i8 %res } @@ -456,13 +454,13 @@ define i8 @twoArgsPromotionZExt(i32 %arg1, i32 %arg2) { ; CHECK-LABEL: @oneArgPromotionNegativeCstZExt ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nuw i64 [[ARG1ZEXT]], 255 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionNegativeCstZExt(i8 %arg1, i8* %base) { %add = add nuw i8 %arg1, -1 %zextadd = zext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %zextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %zextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -470,14 +468,14 @@ define i8 @oneArgPromotionNegativeCstZExt(i8 %arg1, i8* %base) { ; CHECK-LABEL: @oneArgPromotionZExtZExt ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i8 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nuw i64 [[ARG1ZEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionZExtZExt(i8 %arg1, i8* %base) { %zext = zext i8 %arg1 to i32 %add = add nuw i32 %zext, 1 %zextadd = zext i32 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %zextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %zextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -488,15 +486,15 @@ define i8 @oneArgPromotionZExtZExt(i8 %arg1, i8* %base) { ; CHECK: [[ARG1TRUNC:%[a-zA-Z_0-9-]+]] = trunc i32 [[ARG1SEXT]] to i8 ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i8 [[ARG1TRUNC]] to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nuw i64 [[ARG1ZEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionBlockTruncZExt(i1 %arg1, i8* %base) { %sextarg1 = sext i1 %arg1 to i32 %trunc = trunc i32 %sextarg1 to i8 %add = add nuw i8 %trunc, 1 %zextadd = zext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %zextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %zextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -505,15 +503,15 @@ define i8 @oneArgPromotionBlockTruncZExt(i1 %arg1, i8* %base) { ; CHECK-LABEL: @oneArgPromotionPassTruncZExt ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i1 %arg1 to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nuw i64 [[ARG1ZEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionPassTruncZExt(i1 %arg1, i8* %base) { %sextarg1 = zext i1 %arg1 to i32 %trunc = trunc i32 %sextarg1 to i8 %add = add nuw i8 %trunc, 1 %zextadd = zext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %zextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %zextadd + %res = load i8, i8* %arrayidx ret i8 %res } @@ -522,13 +520,13 @@ define i8 @oneArgPromotionPassTruncZExt(i1 %arg1, i8* %base) { ; CHECK: [[ARG1SEXT:%[a-zA-Z_0-9-]+]] = sext i1 %arg1 to i8 ; CHECK: [[ARG1ZEXT:%[a-zA-Z_0-9-]+]] = zext i8 [[ARG1SEXT]] to i64 ; CHECK: [[PROMOTED:%[a-zA-Z_0-9-]+]] = add nuw i64 [[ARG1ZEXT]], 1 -; CHECK: getelementptr inbounds i8* %base, i64 [[PROMOTED]] +; CHECK: getelementptr inbounds i8, i8* %base, i64 [[PROMOTED]] ; CHECK: ret define i8 @oneArgPromotionBlockSExtZExt(i1 %arg1, i8* %base) { %sextarg1 = sext i1 %arg1 to i8 %add = add nuw i8 %sextarg1, 1 %zextadd = zext i8 %add to i64 - %arrayidx = getelementptr inbounds i8* %base, i64 %zextadd - %res = load i8* %arrayidx + %arrayidx = getelementptr inbounds i8, i8* %base, i64 %zextadd + %res = load i8, i8* %arrayidx ret i8 %res } |