diff options
author | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-08 18:19:17 +0000 |
---|---|---|
committer | Bill Schmidt <wschmidt@linux.vnet.ibm.com> | 2013-02-08 18:19:17 +0000 |
commit | 0f58dbae4ab2397dc310e19d171a4bc60fc6c9a7 (patch) | |
tree | 7c7e52d5180abb20a4fe7d79bee1685e75682ecc /test/Analysis/CostModel | |
parent | 33daeab1bb8df65273fd9ecbf1a261f96733732e (diff) | |
download | external_llvm-0f58dbae4ab2397dc310e19d171a4bc60fc6c9a7.zip external_llvm-0f58dbae4ab2397dc310e19d171a4bc60fc6c9a7.tar.gz external_llvm-0f58dbae4ab2397dc310e19d171a4bc60fc6c9a7.tar.bz2 |
Refine fix to bug 15041.
Thanks to help from Nadav and Hal, I have a more reasonable (and even
correct!) approach. This specifically penalizes the insertelement
and extractelement operations for the performance hit that will occur
on PowerPC processors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174725 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/CostModel')
-rw-r--r-- | test/Analysis/CostModel/PowerPC/insert_extract.ll | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Analysis/CostModel/PowerPC/insert_extract.ll b/test/Analysis/CostModel/PowerPC/insert_extract.ll new file mode 100644 index 0000000..f51963d --- /dev/null +++ b/test/Analysis/CostModel/PowerPC/insert_extract.ll @@ -0,0 +1,16 @@ +; RUN: opt < %s -cost-model -analyze -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | 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-f128:128:128-v128:128:128-n32:64" +target triple = "powerpc64-unknown-linux-gnu" + +define i32 @insert(i32 %arg) { + ; CHECK: cost of 13 {{.*}} insertelement + %x = insertelement <4 x i32> undef, i32 %arg, i32 0 + ret i32 undef +} + +define i32 @extract(<4 x i32> %arg) { + ; CHECK: cost of 13 {{.*}} extractelement + %x = extractelement <4 x i32> %arg, i32 0 + ret i32 %x +} + |