Files
clang-p2996/llvm/test/Transforms/LoopVectorize/SystemZ/zero_unroll.ll
Kerry McLaughlin 0d748b4d32 [LoopVectorize] Extract the last lane from a uniform store
Changes VPReplicateRecipe to extract the last lane from an unconditional,
uniform store instruction. collectLoopUniforms will also add stores to
the list of uniform instructions where Legal->isUniformMemOp is true.

setCostBasedWideningDecision now sets the widening decision for
all uniform memory ops to Scalarize, where previously GatherScatter
may have been chosen for scalable stores.

This fixes an assert ("Cannot yet scalarize uniform stores") in
setCostBasedWideningDecision when we have a loop containing a
uniform i1 store and a scalable VF, which we cannot create a scatter for.

Reviewed By: sdesmalen, david-arm, fhahn

Differential Revision: https://reviews.llvm.org/D112725
2021-11-09 14:43:16 +00:00

23 lines
787 B
LLVM

; RUN: opt -S -loop-vectorize -mtriple=s390x-linux-gnu -tiny-trip-count-interleave-threshold=4 -vectorizer-min-trip-count=8 -force-vector-width=4 < %s | FileCheck %s
; RUN: opt -S -passes=loop-vectorize -mtriple=s390x-linux-gnu -tiny-trip-count-interleave-threshold=4 -vectorizer-min-trip-count=8 -force-vector-width=4 < %s | FileCheck %s
define i32 @main(i32 %arg, i8** nocapture readnone %arg1) #0 {
;CHECK: vector.body:
entry:
%0 = alloca i8, align 1
br label %loop
loop:
%storemerge.i.i = phi i8 [ 0, %entry ], [ %tmp12.i.i, %loop ]
store i8 %storemerge.i.i, i8* %0, align 2
%tmp8.i.i = icmp ult i8 %storemerge.i.i, 8
%tmp12.i.i = add nuw nsw i8 %storemerge.i.i, 1
br i1 %tmp8.i.i, label %loop, label %ret
ret:
ret i32 0
}
attributes #0 = { "target-cpu"="z13" }