Skip to content

Commit

Permalink
[RISCV] Add test for unprofitable SLP vectorization
Browse files Browse the repository at this point in the history
Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D149653
  • Loading branch information
lukel97 committed May 19, 2023
1 parent 5ab1333 commit 8288d39
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions llvm/test/Transforms/SLPVectorizer/RISCV/struct-gep.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=slp-vectorizer -mtriple=riscv64 -mattr=+v \
; RUN: -riscv-v-slp-max-vf=0 -S | FileCheck %s

; FIXME: This should not be vectorized

%struct.2i32 = type { i32, i32 }

define void @splat_store_v2i32(ptr %dest, i64 %i) {
; CHECK-LABEL: @splat_store_v2i32(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[P1:%.*]] = getelementptr [[STRUCT_2I32:%.*]], ptr [[DEST:%.*]], i64 [[I:%.*]], i32 0
; CHECK-NEXT: store <2 x i32> <i32 1, i32 1>, ptr [[P1]], align 4
; CHECK-NEXT: ret void
;
entry:
%p1 = getelementptr %struct.2i32, ptr %dest, i64 %i, i32 0
store i32 1, ptr %p1
%p2 = getelementptr %struct.2i32, ptr %dest, i64 %i, i32 1
store i32 1, ptr %p2
ret void
}

0 comments on commit 8288d39

Please sign in to comment.