Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 822b8da

Browse files
committed
[SLPVectorizer] Replace VL[0] to VL0 with assert, add propagateIRFlags extra parameter VL0,
replace E->Scalars[0] to VL0, NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310904 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 7fb0921 commit 822b8da

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/Transforms/Vectorize/SLPVectorizer.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,8 +1424,8 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
14241424

14251425
if (!BS.tryScheduleBundle(VL, this, VL0)) {
14261426
DEBUG(dbgs() << "SLP: We are not able to schedule this bundle!\n");
1427-
assert((!BS.getScheduleData(VL[0]) ||
1428-
!BS.getScheduleData(VL[0])->isPartOfBundle()) &&
1427+
assert((!BS.getScheduleData(VL0) ||
1428+
!BS.getScheduleData(VL0)->isPartOfBundle()) &&
14291429
"tryScheduleBundle should cancelScheduling on failure");
14301430
newTreeEntry(VL, false, UserTreeIdx);
14311431
return;
@@ -2797,7 +2797,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
27972797
V = Builder.CreateICmp(P0, L, R);
27982798

27992799
E->VectorizedValue = V;
2800-
propagateIRFlags(E->VectorizedValue, E->Scalars);
2800+
propagateIRFlags(E->VectorizedValue, E->Scalars, VL0);
28012801
++NumVectorInstructions;
28022802
return V;
28032803
}
@@ -2861,7 +2861,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
28612861
BinaryOperator *BinOp = cast<BinaryOperator>(VL0);
28622862
Value *V = Builder.CreateBinOp(BinOp->getOpcode(), LHS, RHS);
28632863
E->VectorizedValue = V;
2864-
propagateIRFlags(E->VectorizedValue, E->Scalars);
2864+
propagateIRFlags(E->VectorizedValue, E->Scalars, VL0);
28652865
++NumVectorInstructions;
28662866

28672867
if (Instruction *I = dyn_cast<Instruction>(V))
@@ -2974,7 +2974,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
29742974
// ctlz,cttz and powi are special intrinsics whose second argument is
29752975
// a scalar. This argument should not be vectorized.
29762976
if (hasVectorInstrinsicScalarOpd(IID, 1) && j == 1) {
2977-
CallInst *CEI = cast<CallInst>(E->Scalars[0]);
2977+
CallInst *CEI = cast<CallInst>(VL0);
29782978
ScalarArg = CEI->getArgOperand(j);
29792979
OpVecs.push_back(CEI->getArgOperand(j));
29802980
continue;
@@ -3004,7 +3004,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
30043004
ExternalUses.push_back(ExternalUser(ScalarArg, cast<User>(V), 0));
30053005

30063006
E->VectorizedValue = V;
3007-
propagateIRFlags(E->VectorizedValue, E->Scalars);
3007+
propagateIRFlags(E->VectorizedValue, E->Scalars, VL0);
30083008
++NumVectorInstructions;
30093009
return V;
30103010
}
@@ -3673,7 +3673,7 @@ void BoUpSLP::BlockScheduling::resetSchedule() {
36733673
"tried to reset schedule on block which has not been scheduled");
36743674
for (Instruction *I = ScheduleStart; I != ScheduleEnd; I = I->getNextNode()) {
36753675
doForAllOpcodes(I, [this](ScheduleData *SD) {
3676-
assert(isInSchedulingRegion(SD) &&
3676+
assert(isInSchedulingRegion(SD) &&
36773677
"ScheduleData not in scheduling region");
36783678
SD->IsScheduled = false;
36793679
SD->resetUnscheduledDeps();

0 commit comments

Comments
 (0)