[PATCH] D104064: [SLP][NFC] Fix condition that was supposed to save a bit of compile time.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 14:43:26 PDT 2021


vdmitrie created this revision.
vdmitrie added reviewers: spatel, ABataev.
Herald added a subscriber: hiraditya.
vdmitrie requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

It was found by chance revealing discrepancy between comment, few lines above,
 the condition and how re-ordering of instruction is done inside the if statement it guards.
 The condition was always evaluated to true.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104064

Files:
  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp


Index: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
===================================================================
--- llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -6316,7 +6316,7 @@
     ScheduleData *BundleMember = picked;
     while (BundleMember) {
       Instruction *pickedInst = BundleMember->Inst;
-      if (LastScheduledInst->getNextNode() != pickedInst) {
+      if (pickedInst->getNextNode() != LastScheduledInst) {
         BS->BB->getInstList().remove(pickedInst);
         BS->BB->getInstList().insert(LastScheduledInst->getIterator(),
                                      pickedInst);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104064.351266.patch
Type: text/x-patch
Size: 668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210610/953c6bce/attachment.bin>


More information about the llvm-commits mailing list