From 5ad5f5931e34d5be410b1e901640bc1c2d308612 Mon Sep 17 00:00:00 2001 From: Renato Golin Date: Tue, 19 Mar 2013 08:15:38 +0000 Subject: Improve long vector sext/zext lowering on ARM The ARM backend currently has poor codegen for long sext/zext operations, such as v8i8 -> v8i32. This patch addresses this by performing a custom expansion in ARMISelLowering. It also adds/changes the cost of such lowering in ARMTTI. This partially addresses PR14867. Patch by Pete Couperus git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177380 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Analysis/CostModel/ARM/cast.ll | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'test/Analysis/CostModel') diff --git a/test/Analysis/CostModel/ARM/cast.ll b/test/Analysis/CostModel/ARM/cast.ll index 96eb335..ba9d84c 100644 --- a/test/Analysis/CostModel/ARM/cast.ll +++ b/test/Analysis/CostModel/ARM/cast.ll @@ -152,15 +152,29 @@ define i32 @casts() { ; CHECK: cost of 10 {{.*}} uitofp %r69 = uitofp i64 undef to double - ; Vector cast cost of instructions lowering the cast to the stack. - ; CHECK: cost of 24 {{.*}} sext + ; CHECK: cost of 3 {{.*}} sext %r70 = sext <8 x i8> undef to <8 x i32> - ; CHECK: cost of 48 {{.*}} sext + ; CHECK: cost of 6 {{.*}} sext %r71 = sext <16 x i8> undef to <16 x i32> - ; CHECK: cost of 22 {{.*}} zext + ; CHECK: cost of 3 {{.*}} zext %r72 = zext <8 x i8> undef to <8 x i32> - ; CHECK: cost of 44 {{.*}} zext + ; CHECK: cost of 6 {{.*}} zext %r73 = zext <16 x i8> undef to <16 x i32> + + ; CHECK: cost of 7 {{.*}} sext + %rext_0 = sext <8 x i8> undef to <8 x i64> + ; CHECK: cost of 7 {{.*}} zext + %rext_1 = zext <8 x i8> undef to <8 x i64> + ; CHECK: cost of 6 {{.*}} sext + %rext_2 = sext <8 x i16> undef to <8 x i64> + ; CHECK: cost of 6 {{.*}} zext + %rext_3 = zext <8 x i16> undef to <8 x i64> + ; CHECK: cost of 3 {{.*}} sext + %rext_4 = sext <4 x i16> undef to <4 x i64> + ; CHECK: cost of 3 {{.*}} zext + %rext_5 = zext <4 x i16> undef to <4 x i64> + + ; Vector cast cost of instructions lowering the cast to the stack. ; CHECK: cost of 19 {{.*}} trunc %r74 = trunc <8 x i32> undef to <8 x i8> ; CHECK: cost of 38 {{.*}} trunc -- cgit v1.1