[PATCH] D102675: [SLP] Fix "gathering" of vector values
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed May 19 05:39:22 PDT 2021
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3693-3695
+ // No cost for "gathering" already vector value
+ if (isa<FixedVectorType>(VL[0]->getType()))
+ return 0;
----------------
Not sure we should return `0` here, maybe better to return some max cost, like `INT_MAX`?
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4597-4599
+ // "Gathering" of vector values is already done
+ if (isa<FixedVectorType>(Val0->getType()))
+ return Val0;
----------------
Is this correct? Need to return the last insertelement instruction in the sequence
================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/insert-element-build-vector-inseltpoison.ll:45-80
-; CHECK-LABEL: @simple_select_eph(
-; CHECK-NEXT: [[C0:%.*]] = extractelement <4 x i32> [[C:%.*]], i32 0
-; CHECK-NEXT: [[C1:%.*]] = extractelement <4 x i32> [[C]], i32 1
-; CHECK-NEXT: [[C2:%.*]] = extractelement <4 x i32> [[C]], i32 2
-; CHECK-NEXT: [[C3:%.*]] = extractelement <4 x i32> [[C]], i32 3
-; CHECK-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A:%.*]], i32 0
-; CHECK-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i32 1
----------------
Why the check lines are removed?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D102675/new/
https://reviews.llvm.org/D102675
More information about the llvm-commits
mailing list