; RUN: llc -mtriple=aarch64-none-linux-gnu -mattr=+neon < %s | FileCheck %s declare <16 x i8> @llvm.aarch64.neon.tbl1.v16i8(<16 x i8>, <16 x i8>) ; CHECK-LABEL: fun1: ; CHECK: uzp1 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b define i32 @fun1() { entry: %vtbl1.i.1 = tail call <16 x i8> @llvm.aarch64.neon.tbl1.v16i8(<16 x i8> , <16 x i8> undef) %vuzp.i212.1 = shufflevector <16 x i8> %vtbl1.i.1, <16 x i8> undef, <8 x i32> %scevgep = getelementptr <8 x i8>, ptr undef, i64 1 store <8 x i8> %vuzp.i212.1, ptr %scevgep, align 1 ret i32 undef } ; CHECK-LABEL: fun2: ; CHECK: uzp2 {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b define i32 @fun2() { entry: %vtbl1.i.1 = tail call <16 x i8> @llvm.aarch64.neon.tbl1.v16i8(<16 x i8> , <16 x i8> undef) %vuzp.i212.1 = shufflevector <16 x i8> %vtbl1.i.1, <16 x i8> undef, <8 x i32> %scevgep = getelementptr <8 x i8>, ptr undef, i64 1 store <8 x i8> %vuzp.i212.1, ptr %scevgep, align 1 ret i32 undef } ; CHECK-LABEL: fun3: ; CHECK-NOT: uzp1 define i32 @fun3() { entry: %vtbl1.i.1 = tail call <16 x i8> @llvm.aarch64.neon.tbl1.v16i8(<16 x i8> , <16 x i8> undef) %vuzp.i212.1 = shufflevector <16 x i8> %vtbl1.i.1, <16 x i8> undef, <8 x i32> %scevgep = getelementptr <8 x i8>, ptr undef, i64 1 store <8 x i8> %vuzp.i212.1, ptr %scevgep, align 1 ret i32 undef } ; CHECK-LABEL: fun4: ; CHECK-NOT: uzp2 define i32 @fun4() { entry: %vtbl1.i.1 = tail call <16 x i8> @llvm.aarch64.neon.tbl1.v16i8(<16 x i8> , <16 x i8> undef) %vuzp.i212.1 = shufflevector <16 x i8> %vtbl1.i.1, <16 x i8> undef, <8 x i32> %scevgep = getelementptr <8 x i8>, ptr undef, i64 1 store <8 x i8> %vuzp.i212.1, ptr %scevgep, align 1 ret i32 undef } ; CHECK-LABEL: pr36582: ; Check that this does not ICE. define void @pr36582(ptr %p1, ptr %p2) { entry: %wide.vec = load <8 x i8>, ptr %p1, align 1 %strided.vec = shufflevector <8 x i8> %wide.vec, <8 x i8> undef, <4 x i32> %y = zext <4 x i8> %strided.vec to <4 x i32> store <4 x i32> %y, ptr %p2, align 4 ret void } ; Check that this pattern is recognized as a VZIP and ; that the vector blend transform does not scramble the pattern. ; CHECK-LABEL: vzipNoBlend: ; CHECK: zip1 define <8 x i8> @vzipNoBlend(ptr %A, ptr %B) nounwind { %t = load <8 x i8>, ptr %A %vzip = shufflevector <8 x i8> %t, <8 x i8> , <8 x i32> ret <8 x i8> %vzip } ; CHECK-LABEL: vzipNoBlendCommutted: ; CHECK: zip1 define <8 x i8> @vzipNoBlendCommutted(ptr %A, ptr %B) nounwind { %t = load <8 x i8>, ptr %A %vzip = shufflevector <8 x i8> , <8 x i8> %t, <8 x i32> ret <8 x i8> %vzip } ; CHECK-LABEL: vzipStillZExt: ; CHECK: zip1 define <8 x i8> @vzipStillZExt(ptr %A, ptr %B) nounwind { %t = load <8 x i8>, ptr %A %vzip = shufflevector <8 x i8> %t, <8 x i8> , <8 x i32> ret <8 x i8> %vzip } ; CHECK-LABEL: vzipStillZExtCommutted: ; CHECK: zip1 define <8 x i8> @vzipStillZExtCommutted(ptr %A, ptr %B) nounwind { %t = load <8 x i8>, ptr %A %vzip = shufflevector <8 x i8> , <8 x i8> %t, <8 x i32> ret <8 x i8> %vzip }