Skip to content

Commit

Permalink
[SLPVectorizer] Add an extra parameter to tryScheduleBundle function,…
Browse files Browse the repository at this point in the history
… NFCI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@308081 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dtemirbulatov committed Jul 15, 2017
1 parent 7c423e0 commit 31b76d9
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,7 @@ class BoUpSLP {
/// Checks if a bundle of instructions can be scheduled, i.e. has no
/// cyclic dependencies. This is only a dry-run, no instructions are
/// actually moved at this stage.
bool tryScheduleBundle(ArrayRef<Value *> VL, BoUpSLP *SLP);
bool tryScheduleBundle(ArrayRef<Value *> VL, BoUpSLP *SLP, Value *OpValue);

/// Un-bundles a group of instructions.
void cancelScheduling(ArrayRef<Value *> VL, Value *OpValue);
Expand Down Expand Up @@ -1237,7 +1237,7 @@ void BoUpSLP::buildTree_rec(ArrayRef<Value *> VL, unsigned Depth,
}
BlockScheduling &BS = *BSRef.get();

if (!BS.tryScheduleBundle(VL, this)) {
if (!BS.tryScheduleBundle(VL, this, VL0)) {
DEBUG(dbgs() << "SLP: We are not able to schedule this bundle!\n");
assert((!BS.getScheduleData(VL[0]) ||
!BS.getScheduleData(VL[0])->isPartOfBundle()) &&
Expand Down Expand Up @@ -3097,16 +3097,16 @@ void BoUpSLP::optimizeGatherSequence() {
// Groups the instructions to a bundle (which is then a single scheduling entity)
// and schedules instructions until the bundle gets ready.
bool BoUpSLP::BlockScheduling::tryScheduleBundle(ArrayRef<Value *> VL,
BoUpSLP *SLP) {
if (isa<PHINode>(VL[0]))
BoUpSLP *SLP, Value *OpValue) {
if (isa<PHINode>(OpValue))
return true;

// Initialize the instruction bundle.
Instruction *OldScheduleEnd = ScheduleEnd;
ScheduleData *PrevInBundle = nullptr;
ScheduleData *Bundle = nullptr;
bool ReSchedule = false;
DEBUG(dbgs() << "SLP: bundle: " << *VL[0] << "\n");
DEBUG(dbgs() << "SLP: bundle: " << *OpValue << "\n");

// Make sure that the scheduling region contains all
// instructions of the bundle.
Expand Down Expand Up @@ -3177,7 +3177,7 @@ bool BoUpSLP::BlockScheduling::tryScheduleBundle(ArrayRef<Value *> VL,
}
}
if (!Bundle->isReady()) {
cancelScheduling(VL, VL[0]);
cancelScheduling(VL, OpValue);
return false;
}
return true;
Expand Down

0 comments on commit 31b76d9

Please sign in to comment.