mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 20:23:11 +01:00
baa1dd5bfc
This recommits 11ed1c0239fd51fd2f064311dc7725277ed0a994 (reverted in 9f08ce0d2197d4f163dfa4633eae2347ce8fc881 for failing an assert) with a fix: tryToWidenMemory() now first checks if the widening decision is to interleave, thus maintaining previous behavior where tryToInterleaveMemory() was called first, giving priority to interleave decisions over widening/scalarization. This commit adds the test case that exposed this bug as a LIT.
50 lines
2.2 KiB
LLVM
50 lines
2.2 KiB
LLVM
; RUN: opt -S -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -enable-interleaved-mem-accesses=true < %s
|
|
|
|
; Make sure the vectorizer can handle this loop: The strided load is only used
|
|
; by the loop's exit condition, which is not vectorized, and is therefore
|
|
; considered uniform while also forming an interleave group.
|
|
|
|
%0 = type { i32 ()*, i32 }
|
|
|
|
@0 = internal unnamed_addr constant [59 x %0] [%0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 {i32 ()* null, i32 258}, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer, %0 zeroinitializer, %0 zeroinitializer,
|
|
%0 zeroinitializer], align 8
|
|
|
|
define dso_local void @test_dead_load(i32 %arg) {
|
|
; CHECK-LABEL: @test_dead_load(
|
|
; CHECK: vector.body:
|
|
; CHECK: %wide.vec = load <16 x i32>, <16 x i32>* %3, align 8
|
|
; CHECK: %strided.vec = shufflevector <16 x i32> %wide.vec, <16 x i32> undef, <4 x i32> <i32 0, i32 4, i32 8, i32 12>
|
|
bb1:
|
|
br label %bb2
|
|
|
|
bb2:
|
|
%tmp = phi %0* [ %tmp6, %bb2 ], [ getelementptr inbounds ([59 x %0], [59 x %0]* @0, i64 0, i64 0), %bb1 ]
|
|
%tmp3 = getelementptr inbounds %0, %0* %tmp, i64 0, i32 1
|
|
%tmp4 = load i32, i32* %tmp3, align 8
|
|
%tmp5 = icmp eq i32 %tmp4, 258
|
|
%tmp6 = getelementptr inbounds %0, %0* %tmp, i64 1
|
|
br i1 %tmp5, label %bb65, label %bb2
|
|
|
|
bb65:
|
|
unreachable
|
|
}
|