summaryrefslogtreecommitdiff
path: root/test/Analysis/CostModel
diff options
context:
space:
mode:
authorArnold Schwaighofer <aschwaighofer@apple.com>2013-03-12 21:19:22 +0000
committerArnold Schwaighofer <aschwaighofer@apple.com>2013-03-12 21:19:22 +0000
commitb6f4872d29136637a3a5dfdf185f5afcbcdd3b2a (patch)
tree96c33d70c7bee11fa399affadb5339c42a8835df /test/Analysis/CostModel
parent9e999adb48beb61663f6abca667b8c85068ee585 (diff)
downloadllvm-b6f4872d29136637a3a5dfdf185f5afcbcdd3b2a.tar.gz
llvm-b6f4872d29136637a3a5dfdf185f5afcbcdd3b2a.tar.bz2
llvm-b6f4872d29136637a3a5dfdf185f5afcbcdd3b2a.tar.xz
ARM cost model: Increase the cost for vector casts that use the stack
Increase the cost of v8/v16-i8 to v8/v16-i32 casts and truncates as the backend currently lowers those using stack accesses. This was responsible for a significant degradation on MultiSource/Benchmarks/Trimaran/enc-pc1/enc-pc1 where we vectorize one loop to a vector factor of 16. After this patch we select a vector factor of 4 which will generate reasonable code. unsigned char cle[32]; void test(short c) { unsigned short compte; for (compte = 0; compte <= 31; compte++) { cle[compte] = cle[compte] ^ c; } } radar://13220512 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176898 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/CostModel')
-rw-r--r--test/Analysis/CostModel/ARM/cast.ll14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/Analysis/CostModel/ARM/cast.ll b/test/Analysis/CostModel/ARM/cast.ll
index 464b6ece0e..779c4384e8 100644
--- a/test/Analysis/CostModel/ARM/cast.ll
+++ b/test/Analysis/CostModel/ARM/cast.ll
@@ -152,6 +152,20 @@ 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
+ %r70 = sext <8 x i8> undef to <8 x i32>
+ ; CHECK: cost of 48 {{.*}} sext
+ %r71 = sext <16 x i8> undef to <16 x i32>
+ ; CHECK: cost of 22 {{.*}} zext
+ %r72 = zext <8 x i8> undef to <8 x i32>
+ ; CHECK: cost of 44 {{.*}} zext
+ %r73 = zext <16 x i8> undef to <16 x i32>
+ ; CHECK: cost of 19 {{.*}} trunc
+ %r74 = trunc <8 x i32> undef to <8 x i8>
+ ; CHECK: cost of 38 {{.*}} trunc
+ %r75 = trunc <16 x i32> undef to <16 x i8>
+
;CHECK: cost of 0 {{.*}} ret
ret i32 undef
}