[llvm] 6888081 - [SLP] Use moveBefore to simplify code [NFC]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 28 12:44:19 PST 2022
Author: Philip Reames
Date: 2022-01-28T12:44:07-08:00
New Revision: 6888081e32c45a7bb88cfc883a38bce5e5ccc0b8
URL: https://github.com/llvm/llvm-project/commit/6888081e32c45a7bb88cfc883a38bce5e5ccc0b8
DIFF: https://github.com/llvm/llvm-project/commit/6888081e32c45a7bb88cfc883a38bce5e5ccc0b8.diff
LOG: [SLP] Use moveBefore to simplify code [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 967e527b16d51..25bf69729c70f 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -7680,11 +7680,8 @@ void BoUpSLP::scheduleBlock(BlockScheduling *BS) {
for (ScheduleData *BundleMember = picked; BundleMember;
BundleMember = BundleMember->NextInBundle) {
Instruction *pickedInst = BundleMember->Inst;
- if (pickedInst->getNextNode() != LastScheduledInst) {
- BS->BB->getInstList().remove(pickedInst);
- BS->BB->getInstList().insert(LastScheduledInst->getIterator(),
- pickedInst);
- }
+ if (pickedInst->getNextNode() != LastScheduledInst)
+ pickedInst->moveBefore(LastScheduledInst);
LastScheduledInst = pickedInst;
}
More information about the llvm-commits
mailing list