diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-12-05 21:21:26 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-12-05 21:21:26 +0000 |
commit | 0602bb46596485b43fa8b86abbc8485d502025ce (patch) | |
tree | c0d06457ae762383e00ca62e85b0b010803ffbdf | |
parent | f2a1c83c86ceefb9a241aa728d1d1239a64b894e (diff) |
Cost Model: change the default cost of control flow instructions (br / ret / ...) to zero.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169423 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/TargetTransformImpl.cpp | 2 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/arith.ll | 4 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/cast.ll | 2 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/cmp.ll | 2 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/i32.ll | 2 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/tiny.ll | 2 | ||||
-rw-r--r-- | test/Analysis/CostModel/X86/vectorized-loop.ll | 6 |
7 files changed, 10 insertions, 10 deletions
diff --git a/lib/Target/TargetTransformImpl.cpp b/lib/Target/TargetTransformImpl.cpp index b36e6f858f..2df72630bb 100644 --- a/lib/Target/TargetTransformImpl.cpp +++ b/lib/Target/TargetTransformImpl.cpp @@ -283,7 +283,7 @@ unsigned VectorTargetTransformImpl::getCastInstrCost(unsigned Opcode, Type *Dst, } unsigned VectorTargetTransformImpl::getCFInstrCost(unsigned Opcode) const { - return 1; + return 0; } unsigned VectorTargetTransformImpl::getCmpSelInstrCost(unsigned Opcode, diff --git a/test/Analysis/CostModel/X86/arith.ll b/test/Analysis/CostModel/X86/arith.ll index 37cca8d540..ae78d44aeb 100644 --- a/test/Analysis/CostModel/X86/arith.ll +++ b/test/Analysis/CostModel/X86/arith.ll @@ -14,7 +14,7 @@ define i32 @add(i32 %arg) { %D = add <4 x i64> undef, undef ;CHECK: cost of 8 {{.*}} add %E = add <8 x i64> undef, undef - ;CHECK: cost of 1 {{.*}} ret + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } @@ -28,7 +28,7 @@ define i32 @xor(i32 %arg) { %C = xor <2 x i64> undef, undef ;CHECK: cost of 1 {{.*}} xor %D = xor <4 x i64> undef, undef - ;CHECK: cost of 1 {{.*}} ret + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } diff --git a/test/Analysis/CostModel/X86/cast.ll b/test/Analysis/CostModel/X86/cast.ll index 75c97a781e..cedc682598 100644 --- a/test/Analysis/CostModel/X86/cast.ll +++ b/test/Analysis/CostModel/X86/cast.ll @@ -28,7 +28,7 @@ define i32 @add(i32 %arg) { ;CHECK: cost of 0 {{.*}} trunc %H = trunc i32 undef to i1 - ;CHECK: cost of 1 {{.*}} ret + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } diff --git a/test/Analysis/CostModel/X86/cmp.ll b/test/Analysis/CostModel/X86/cmp.ll index f868bd18b5..90b09c1154 100644 --- a/test/Analysis/CostModel/X86/cmp.ll +++ b/test/Analysis/CostModel/X86/cmp.ll @@ -35,7 +35,7 @@ define i32 @cmp(i32 %arg) { ;CHECK: cost of 4 {{.*}} icmp %M = icmp eq <32 x i8> undef, undef - ;CHECK: cost of 1 {{.*}} ret + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } diff --git a/test/Analysis/CostModel/X86/i32.ll b/test/Analysis/CostModel/X86/i32.ll index 4015e0b1ee..52c295934c 100644 --- a/test/Analysis/CostModel/X86/i32.ll +++ b/test/Analysis/CostModel/X86/i32.ll @@ -2,7 +2,7 @@ ;CHECK: cost of 2 {{.*}} add -;CHECK: cost of 1 {{.*}} ret +;CHECK: cost of 0 {{.*}} ret define i32 @no_info(i32 %arg) { %e = add i64 undef, undef ret i32 undef diff --git a/test/Analysis/CostModel/X86/tiny.ll b/test/Analysis/CostModel/X86/tiny.ll index cc7b443a7d..0dafdadb5b 100644 --- a/test/Analysis/CostModel/X86/tiny.ll +++ b/test/Analysis/CostModel/X86/tiny.ll @@ -4,7 +4,7 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3 target triple = "x86_64-apple-macosx10.8.0" ;CHECK: cost of 1 {{.*}} add -;CHECK: cost of 1 {{.*}} ret +;CHECK: cost of 0 {{.*}} ret define i32 @no_info(i32 %arg) { %e = add i32 %arg, %arg ret i32 %e diff --git a/test/Analysis/CostModel/X86/vectorized-loop.ll b/test/Analysis/CostModel/X86/vectorized-loop.ll index 7919a9ca9a..6c9e111bb1 100644 --- a/test/Analysis/CostModel/X86/vectorized-loop.ll +++ b/test/Analysis/CostModel/X86/vectorized-loop.ll @@ -41,7 +41,7 @@ vector.body: ; preds = %for.body.lr.ph, %ve store <8 x i32> %11, <8 x i32>* %9, align 4 %index.next = add i64 %index, 8 %12 = icmp eq i64 %index.next, %end.idx.rnd.down - ;CHECK: cost of 1 {{.*}} br + ;CHECK: cost of 0 {{.*}} br br i1 %12, label %middle.block, label %vector.body middle.block: ; preds = %vector.body, %for.body.lr.ph @@ -65,11 +65,11 @@ for.body: ; preds = %middle.block, %for. ;CHECK: cost of 0 {{.*}} trunc %16 = trunc i64 %indvars.iv.next to i32 %cmp = icmp slt i32 %16, %end - ;CHECK: cost of 1 {{.*}} br + ;CHECK: cost of 0 {{.*}} br br i1 %cmp, label %for.body, label %for.end for.end: ; preds = %middle.block, %for.body, %entry - ;CHECK: cost of 1 {{.*}} ret + ;CHECK: cost of 0 {{.*}} ret ret i32 undef } |