[PATCH] D80241: [SLP] PR45269 Fix getVectorElementSize() is slow
Dinar Temirbulatov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 20 07:04:43 PDT 2020
dtemirbulatov marked 2 inline comments as done.
dtemirbulatov added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5355-5357
+ auto E = InstrElementSize.find(Inst);
+ if (E != InstrElementSize.end())
+ return E->second;
----------------
ABataev wrote:
> This code can be moved out of the if statement. Make `InstrElementSize` to use `Value *` as a key and check if `V` is processed already before the declaration of `Worklist` and `Visited` vars.
ok
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:5387
if (auto *J = dyn_cast<Instruction>(U.get()))
- if (Visited.insert(J).second)
+ if (P == J->getParent() && Visited.insert(J).second)
Worklist.push_back(J);
----------------
ABataev wrote:
> Why do you need this change?
eh, yes, Instructions from a different basic block is the rear case here, I will remove this change.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80241/new/
https://reviews.llvm.org/D80241
More information about the llvm-commits
mailing list