From 72dfa16aa9f9cae748e13a9d2e7d633ff6379c2b Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Thu, 5 Jun 2014 22:57:38 +0000 Subject: [PATCH] [PPC64LE] Add test case for r210282 commit Chandler correctly pointed out that I need an LLVM IR test for r210282, which modified the vperm -> shuffle transform for little endian PowerPC. This patch provides that test. llvm-svn: 210297 --- llvm/test/CodeGen/PowerPC/vperm-instcombine.ll | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 llvm/test/CodeGen/PowerPC/vperm-instcombine.ll diff --git a/llvm/test/CodeGen/PowerPC/vperm-instcombine.ll b/llvm/test/CodeGen/PowerPC/vperm-instcombine.ll new file mode 100644 index 0000000..d9084c8 --- /dev/null +++ b/llvm/test/CodeGen/PowerPC/vperm-instcombine.ll @@ -0,0 +1,17 @@ +; RUN: opt < %s -instcombine -S | FileCheck %s + +target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v128:128:128-n32:64" +target triple = "powerpc64le-unknown-linux-gnu" + +define <16 x i8> @foo() nounwind ssp { +; CHECK: @foo +;; Arguments are {0,1,...,15},{16,17,...,31},{30,28,26,...,0} + %1 = call <4 x i32> @llvm.ppc.altivec.vperm(<4 x i32> , <4 x i32> , <16 x i8> ) + %2 = bitcast <4 x i32> %1 to <16 x i8> + ret <16 x i8> %2 +;; Revised arguments are {16,17,...31},{0,1,...,15},{1,3,5,...,31} +;; optimized into the following: +; CHECK: ret <16 x i8> +} + +declare <4 x i32> @llvm.ppc.altivec.vperm(<4 x i32>, <4 x i32>, <16 x i8>) -- 2.7.4