[PATCH] D59956: [SLP] Add support for swapping icmp/fcmp predicates to permit vectorization

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 13:05:17 PDT 2019


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1860
+      for (Value *V : VL) {
+        CmpInst *Cmp = cast<CmpInst>(V);
+        auto LHS = Cmp->getOperand(0);
----------------
`CmpInst *`->`auto *`. You need always to add `&` or `*` to the `auto` (if any can be applied) to make it easier to read the code.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1861
+        CmpInst *Cmp = cast<CmpInst>(V);
+        auto LHS = Cmp->getOperand(0);
+        auto RHS = Cmp->getOperand(1);
----------------
Better to use `Value *` here because it is not easy to deduce the type from the operation.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1862
+        auto LHS = Cmp->getOperand(0);
+        auto RHS = Cmp->getOperand(1);
+        if (Cmp->getPredicate() != P0)
----------------
Same here


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59956/new/

https://reviews.llvm.org/D59956





More information about the llvm-commits mailing list