[PATCH] D22554: [SLP] Vectorize loads in horizontal reductions when they happen to be in the reverse order

Matthew Simpson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 13:50:37 PDT 2016


mssimpso accepted this revision.
mssimpso added a comment.
This revision is now accepted and ready to land.

LGTM after a few more changes. Thanks!


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1206-1209
@@ -1177,5 +1205,6 @@
+
       ++NumLoadsWantToKeepOrder;
       newTreeEntry(VL, true);
       DEBUG(dbgs() << "SLP: added a vector of loads.\n");
       return;
     }
----------------
I think this would be more clear if instead of the !Consecutive check, we have the following after setting Consecutive/ReverseConsecutive

```
if (Consecutive) {
  ++NumLoadsWantToKeepOrder;
  newTreeEntry(VL, true);
  DEBUG(dbgs() << "SLP: added a vector of loads.\n");
  return;
}

// If none of the load pairs...
```

================
Comment at: test/Transforms/SLPVectorizer/X86/reduction_loads.ll:1
@@ +1,2 @@
+; RUN: opt < %s -basicaa -slp-vectorizer -dce -S -mtriple=x86_64-apple-macosx10.10.0 -mattr=+sse4.2 | FileCheck %s
+
----------------
You don't need the basicaa or dce flags for this test.


https://reviews.llvm.org/D22554





More information about the llvm-commits mailing list