[PATCH] D123494: [VectorCombine] Find and remove shuffles from commutative reductions

Sam Tebbs via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 08:08:52 PDT 2022


samtebbs added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/VectorCombine.cpp:1162
+    if (auto *CI = dyn_cast<Instruction>(CV)) {
+      if (CI->isBinaryOp()) {
+        for (auto *Op : CI->operand_values())
----------------
Does this also need to check if the binary operation is commutative? It may be a good idea to add a test with a non-commutative reduction and a qualifying shuffle, to make sure this function's behaviour isn't broken in the future.


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

https://reviews.llvm.org/D123494



More information about the llvm-commits mailing list