[PATCH] D28907: [SLP] Fix for PR30787: Failure to beneficially vectorize 'copyable' elements in integer binary ops.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 28 13:16:39 PDT 2018


ABataev added a comment.

Why you don't want to use `pair<Instruction*, Opcode>` as the key in all maps/sets? I expect that it will lead to much more simpler slution.



================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:308
+static unsigned tryToRepresentAsInstArg(unsigned Opcode, Instruction *I) {
+  if (Opcode != Instruction::PHI &&
+      I->getOpcode() != Instruction::PHI &&
----------------
Instead, I would check for the supported instructions rather than for the unsupported ones.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:398
+    unsigned InstOpcode = I->getOpcode();
+    Hash += hash_combine(InstOpcode, Cnt,
+                hash_combine_range(I->value_op_begin(),
----------------
Not sure if this always produces unique hashes, might lead to the incorrect compiler work.


https://reviews.llvm.org/D28907





More information about the llvm-commits mailing list