[llvm] 118babe - [SLP] Use for loops for walking bundle elements
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 20 12:44:41 PST 2022
Author: Philip Reames
Date: 2022-01-20T12:44:33-08:00
New Revision: 118babe67adfe3eed1a6d89e3c2d5a70ba8322a4
URL: https://github.com/llvm/llvm-project/commit/118babe67adfe3eed1a6d89e3c2d5a70ba8322a4
DIFF: https://github.com/llvm/llvm-project/commit/118babe67adfe3eed1a6d89e3c2d5a70ba8322a4.diff
LOG: [SLP] Use for loops for walking bundle elements
Added:
Modified:
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index d9d02cb56c44..dfda6a97303c 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2521,12 +2521,11 @@ class BoUpSLP {
SD->IsScheduled = true;
LLVM_DEBUG(dbgs() << "SLP: schedule " << *SD << "\n");
- ScheduleData *BundleMember = SD;
- while (BundleMember) {
- if (BundleMember->Inst != BundleMember->OpValue) {
- BundleMember = BundleMember->NextInBundle;
+ for (ScheduleData *BundleMember = SD; BundleMember;
+ BundleMember = BundleMember->NextInBundle) {
+ if (BundleMember->Inst != BundleMember->OpValue)
continue;
- }
+
// Handle the def-use chain dependencies.
// Decrement the unscheduled counter and insert to ready list if ready.
@@ -2591,7 +2590,6 @@ class BoUpSLP {
<< "SLP: gets ready (mem): " << *DepBundle << "\n");
}
}
- BundleMember = BundleMember->NextInBundle;
}
}
@@ -7659,8 +7657,8 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) {
// Move the scheduled instruction(s) to their dedicated places, if not
// there yet.
- ScheduleData *BundleMember = picked;
- while (BundleMember) {
+ for (ScheduleData *BundleMember = picked; BundleMember;
+ BundleMember = BundleMember->NextInBundle) {
Instruction *pickedInst = BundleMember->Inst;
if (pickedInst->getNextNode() != LastScheduledInst) {
BS->BB->getInstList().remove(pickedInst);
@@ -7668,7 +7666,6 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) {
pickedInst);
}
LastScheduledInst = pickedInst;
- BundleMember = BundleMember->NextInBundle;
}
BS->schedule(picked, ReadyInsts);
More information about the llvm-commits
mailing list