[llvm] c104fca - {SLP] Delete dead code in favor of proper assert [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 20 08:56:31 PST 2022
Author: Philip Reames
Date: 2022-01-20T08:54:12-08:00
New Revision: c104fca36b96203a36ef339e7548f14888013a2e
URL: https://github.com/llvm/llvm-project/commit/c104fca36b96203a36ef339e7548f14888013a2e
DIFF: https://github.com/llvm/llvm-project/commit/c104fca36b96203a36ef339e7548f14888013a2e.diff
LOG: {SLP] Delete dead code in favor of proper assert [NFC]
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 5dbd975f58da..43119b9c80cb 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7515,22 +7515,16 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
}
} else {
for (User *U : BundleMember->Inst->users()) {
- if (isa<Instruction>(U)) {
- ScheduleData *UseSD = getScheduleData(U);
- if (UseSD && isInSchedulingRegion(UseSD->FirstInBundle)) {
- BundleMember->Dependencies++;
- ScheduleData *DestBundle = UseSD->FirstInBundle;
- if (!DestBundle->IsScheduled)
- BundleMember->incrementUnscheduledDeps(1);
- if (!DestBundle->hasValidDependencies())
- WorkList.push_back(DestBundle);
- }
- } else {
- // I'm not sure if this can ever happen. But we need to be safe.
- // This lets the instruction/bundle never be scheduled and
- // eventually disable vectorization.
+ assert(isa<Instruction>(U) &&
+ "user of instruction must be instruction");
+ ScheduleData *UseSD = getScheduleData(U);
+ if (UseSD && isInSchedulingRegion(UseSD->FirstInBundle)) {
BundleMember->Dependencies++;
- BundleMember->incrementUnscheduledDeps(1);
+ ScheduleData *DestBundle = UseSD->FirstInBundle;
+ if (!DestBundle->IsScheduled)
+ BundleMember->incrementUnscheduledDeps(1);
+ if (!DestBundle->hasValidDependencies())
+ WorkList.push_back(DestBundle);
}
}
}
More information about the llvm-commits
mailing list