Skip to content

Commit 95a9372

Browse files
committed
[LV] Remove what seems like stale code in collectElementTypesForWidening.
This was originally added in rG22174f5d5af1eb15b376c6d49e7925cbb7cca6be although that patch doesn't really mention any reasons for ignoring the pointer type in this calculation if the memory access isn't consecutive. Reviewed By: david-arm Differential Revision: https://reviews.llvm.org/D115356
1 parent 395f737 commit 95a9372

File tree

2 files changed

+3
-13
lines changed

2 files changed

+3
-13
lines changed

llvm/lib/Transforms/Vectorize/LoopVectorize.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5990,17 +5990,7 @@ void LoopVectorizationCostModel::collectElementTypesForWidening() {
59905990
if (auto *ST = dyn_cast<StoreInst>(&I))
59915991
T = ST->getValueOperand()->getType();
59925992

5993-
// Ignore loaded pointer types and stored pointer types that are not
5994-
// vectorizable.
5995-
//
5996-
// FIXME: The check here attempts to predict whether a load or store will
5997-
// be vectorized. We only know this for certain after a VF has
5998-
// been selected. Here, we assume that if an access can be
5999-
// vectorized, it will be. We should also look at extending this
6000-
// optimization to non-pointer types.
6001-
//
6002-
if (T->isPointerTy() && !isConsecutiveLoadOrStore(&I) &&
6003-
!isAccessInterleaved(&I) && !isLegalGatherOrScatter(&I))
5993+
if (!T->isSized())
60045994
continue;
60055995

60065996
ElementTypesInLoop.insert(T);

llvm/test/Transforms/LoopVectorize/X86/vector_ptr_load_store.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ define void @test_consecutive_store(%0**, %0**, %0** nocapture) nounwind ssp uwt
5252
; p[i][y] = (int*) (1 + q[i]);
5353
; }
5454
; CHECK: test_nonconsecutive_store
55-
; CHECK: LV: The Smallest and Widest types: 16 / 16 bits.
55+
; CHECK: LV: The Smallest and Widest types: 16 / 64 bits.
5656
; CHECK: LV: Selecting VF: 1
5757
define void @test_nonconsecutive_store() nounwind ssp uwtable {
5858
br label %1
@@ -120,7 +120,7 @@ define i8 @test_consecutive_ptr_load() nounwind readonly ssp uwtable {
120120

121121
;; However, we should not take unconsecutive loads of pointers into account.
122122
; CHECK: test_nonconsecutive_ptr_load
123-
; CHECK: LV: The Smallest and Widest types: 16 / 16 bits.
123+
; CHECK: LV: The Smallest and Widest types: 16 / 64 bits.
124124
; CHECK: LV: Selecting VF: 1
125125
define void @test_nonconsecutive_ptr_load() nounwind ssp uwtable {
126126
br label %1

0 commit comments

Comments
 (0)