Skip to content

Commit 6dd9322

Browse files
committed
Remove redundant IntegerType::get, remove redundant block in tests
1 parent 1634aaf commit 6dd9322

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,8 +1515,8 @@ static void transformRecipestoEVLRecipes(VPlan &Plan, VPValue &EVL) {
15151515
assert(VPIntrinsic::getMaskParamPos(VPID) &&
15161516
VPIntrinsic::getVectorLengthParamPos(VPID) &&
15171517
"Expected VP intrinsic");
1518-
VPValue *Mask = Plan.getOrAddLiveIn(
1519-
ConstantInt::getTrue(IntegerType::getInt1Ty(Ctx)));
1518+
VPValue *Mask =
1519+
Plan.getOrAddLiveIn(ConstantInt::getTrue(Ctx));
15201520
Ops.push_back(Mask);
15211521
Ops.push_back(&EVL);
15221522
return new VPWidenIntrinsicRecipe(

llvm/test/Transforms/LoopVectorize/RISCV/vectorize-force-tail-with-evl-cast-intrinsics.ll

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,10 +1107,6 @@ define void @truncate_to_minimal_bitwidths_widen_cast_recipe(ptr noalias %dst, p
11071107
; IF-EVL: [[SCALAR_PH]]:
11081108
; IF-EVL-NEXT: [[BC_RESUME_VAL:%.*]] = phi i64 [ [[N_VEC]], %[[MIDDLE_BLOCK]] ], [ 0, %[[FOR_BODY13_PREHEADER]] ]
11091109
; IF-EVL-NEXT: br label %[[FOR_BODY13:.*]]
1110-
; IF-EVL: [[FOR_COND_CLEANUP12_LOOPEXIT]]:
1111-
; IF-EVL-NEXT: br label %[[FOR_COND_CLEANUP12]]
1112-
; IF-EVL: [[FOR_COND_CLEANUP12]]:
1113-
; IF-EVL-NEXT: ret void
11141110
; IF-EVL: [[FOR_BODY13]]:
11151111
; IF-EVL-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ [[BC_RESUME_VAL]], %[[SCALAR_PH]] ], [ [[INDVARS_IV_NEXT:%.*]], %[[FOR_BODY13]] ]
11161112
; IF-EVL-NEXT: [[ARRAYIDX15:%.*]] = getelementptr i8, ptr [[SRC]], i64 [[INDVARS_IV]]
@@ -1123,6 +1119,10 @@ define void @truncate_to_minimal_bitwidths_widen_cast_recipe(ptr noalias %dst, p
11231119
; IF-EVL-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
11241120
; IF-EVL-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
11251121
; IF-EVL-NEXT: br i1 [[EXITCOND_NOT]], label %[[FOR_COND_CLEANUP12_LOOPEXIT]], label %[[FOR_BODY13]], !llvm.loop [[LOOP48:![0-9]+]]
1122+
; IF-EVL: [[FOR_COND_CLEANUP12_LOOPEXIT]]:
1123+
; IF-EVL-NEXT: br label %[[FOR_COND_CLEANUP12]]
1124+
; IF-EVL: [[FOR_COND_CLEANUP12]]:
1125+
; IF-EVL-NEXT: ret void
11261126
;
11271127
; NO-VP-LABEL: define void @truncate_to_minimal_bitwidths_widen_cast_recipe(
11281128
; NO-VP-SAME: ptr noalias [[DST:%.*]], ptr noalias [[SRC:%.*]], i32 [[MVX:%.*]]) #[[ATTR0]] {
@@ -1132,10 +1132,6 @@ define void @truncate_to_minimal_bitwidths_widen_cast_recipe(ptr noalias %dst, p
11321132
; NO-VP: [[FOR_BODY13_PREHEADER]]:
11331133
; NO-VP-NEXT: [[WIDE_TRIP_COUNT:%.*]] = zext nneg i32 [[MVX]] to i64
11341134
; NO-VP-NEXT: br label %[[FOR_BODY13:.*]]
1135-
; NO-VP: [[FOR_COND_CLEANUP12_LOOPEXIT:.*]]:
1136-
; NO-VP-NEXT: br label %[[FOR_COND_CLEANUP12]]
1137-
; NO-VP: [[FOR_COND_CLEANUP12]]:
1138-
; NO-VP-NEXT: ret void
11391135
; NO-VP: [[FOR_BODY13]]:
11401136
; NO-VP-NEXT: [[INDVARS_IV:%.*]] = phi i64 [ 0, %[[FOR_BODY13_PREHEADER]] ], [ [[INDVARS_IV_NEXT:%.*]], %[[FOR_BODY13]] ]
11411137
; NO-VP-NEXT: [[ARRAYIDX15:%.*]] = getelementptr i8, ptr [[SRC]], i64 [[INDVARS_IV]]
@@ -1147,7 +1143,11 @@ define void @truncate_to_minimal_bitwidths_widen_cast_recipe(ptr noalias %dst, p
11471143
; NO-VP-NEXT: store i8 [[CONV36]], ptr [[DST]], align 1
11481144
; NO-VP-NEXT: [[INDVARS_IV_NEXT]] = add nuw nsw i64 [[INDVARS_IV]], 1
11491145
; NO-VP-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT]], [[WIDE_TRIP_COUNT]]
1150-
; NO-VP-NEXT: br i1 [[EXITCOND_NOT]], label %[[FOR_COND_CLEANUP12_LOOPEXIT]], label %[[FOR_BODY13]]
1146+
; NO-VP-NEXT: br i1 [[EXITCOND_NOT]], label %[[FOR_COND_CLEANUP12_LOOPEXIT:.*]], label %[[FOR_BODY13]]
1147+
; NO-VP: [[FOR_COND_CLEANUP12_LOOPEXIT]]:
1148+
; NO-VP-NEXT: br label %[[FOR_COND_CLEANUP12]]
1149+
; NO-VP: [[FOR_COND_CLEANUP12]]:
1150+
; NO-VP-NEXT: ret void
11511151
;
11521152
entry:
11531153
%cmp111 = icmp sgt i32 %mvx, 0
@@ -1157,12 +1157,6 @@ for.body13.preheader: ; preds = %entry
11571157
%wide.trip.count = zext nneg i32 %mvx to i64
11581158
br label %for.body13
11591159

1160-
for.cond.cleanup12.loopexit: ; preds = %for.body13
1161-
br label %for.cond.cleanup12
1162-
1163-
for.cond.cleanup12: ; preds = %for.cond.cleanup12.loopexit, %entry
1164-
ret void
1165-
11661160
for.body13: ; preds = %for.body13.preheader, %for.body13
11671161
%indvars.iv = phi i64 [ 0, %for.body13.preheader ], [ %indvars.iv.next, %for.body13 ]
11681162
%arrayidx15 = getelementptr i8, ptr %src, i64 %indvars.iv
@@ -1174,7 +1168,10 @@ for.body13: ; preds = %for.body13.preheade
11741168
store i8 %conv36, ptr %dst, align 1
11751169
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
11761170
%exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
1177-
br i1 %exitcond.not, label %for.cond.cleanup12.loopexit, label %for.body13
1171+
br i1 %exitcond.not, label %for.cond.cleanup12, label %for.body13
1172+
1173+
for.cond.cleanup12: ; preds = %for.body13, %entry
1174+
ret void
11781175
}
11791176

11801177
;.

0 commit comments

Comments
 (0)