[llvm] a4541fd - [SLP] Replace a impossible branch condition with an assert [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 23 13:43:54 PST 2022
Author: Philip Reames
Date: 2022-02-23T13:43:45-08:00
New Revision: a4541fdfe480dd42b9dff725b6811256ebdf9d14
URL: https://github.com/llvm/llvm-project/commit/a4541fdfe480dd42b9dff725b6811256ebdf9d14
DIFF: https://github.com/llvm/llvm-project/commit/a4541fdfe480dd42b9dff725b6811256ebdf9d14.diff
LOG: [SLP] Replace a impossible branch condition with an assert [NFC]
An entire bundle must be inside the scheduling window. Assert that this property holds as opposed to checking it at runtime.
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 d6ee0300d3296..387d144d89a3c 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -2759,6 +2759,8 @@ class BoUpSLP {
assert(SD && "primary scheduledata must exist in window");
assert(isInSchedulingRegion(SD) &&
"primary schedule data not in window?");
+ assert(isInSchedulingRegion(SD->FirstInBundle) &&
+ "entire bundle in window!");
(void)SD;
doForAllOpcodes(I, [](ScheduleData *SD) { SD->verify(); });
}
@@ -7765,8 +7767,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
// Handle def-use chain dependencies.
if (BundleMember->OpValue != BundleMember->Inst) {
- ScheduleData *UseSD = getScheduleData(BundleMember->Inst);
- if (UseSD && isInSchedulingRegion(UseSD->FirstInBundle)) {
+ if (ScheduleData *UseSD = getScheduleData(BundleMember->Inst)) {
BundleMember->Dependencies++;
ScheduleData *DestBundle = UseSD->FirstInBundle;
if (!DestBundle->IsScheduled)
@@ -7776,10 +7777,7 @@ void BoUpSLP::BlockScheduling::calculateDependencies(ScheduleData *SD,
}
} else {
for (User *U : BundleMember->Inst->users()) {
- assert(isa<Instruction>(U) &&
- "user of instruction must be instruction");
- ScheduleData *UseSD = getScheduleData(U);
- if (UseSD && isInSchedulingRegion(UseSD->FirstInBundle)) {
+ if (ScheduleData *UseSD = getScheduleData(cast<Instruction>(U))) {
BundleMember->Dependencies++;
ScheduleData *DestBundle = UseSD->FirstInBundle;
if (!DestBundle->IsScheduled)
More information about the llvm-commits
mailing list