[PATCH] D83779: [SLP] Fix order of `insertelement`/`insertvalue` seed operands
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 15 05:46:31 PDT 2020
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7078
+static unsigned int getAggregateSize(Instruction *InsertInst) {
+ return 2;
----------------
Why need a parameter here? Why always return `2`?
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7087-7088
+ return CI->getZExtValue();
+ else
+ return 0;
+ } else {
----------------
Just `return 0;`, no need for `else`
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7089-7099
+ } else {
+ auto *IV = cast<InsertValueInst>(InsertInst);
+ Type *AggregateType = cast<StructType>(InsertInst->getType());
+ unsigned int OperandIndex = 0;
+ Type *CurrentType = IV->getType();
+ for (auto i : IV->indices()) {
+ AggregateType->getElementType(i);
----------------
No need for `else`.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:7094
+ Type *CurrentType = IV->getType();
+ for (auto i : IV->indices()) {
+ AggregateType->getElementType(i);
----------------
Use actual type and `i`->`I`
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D83779/new/
https://reviews.llvm.org/D83779
More information about the llvm-commits
mailing list