[llvm-commits] [llvm] r169423 - in /llvm/trunk: lib/Target/TargetTransformImpl.cpp test/Analysis/CostModel/X86/arith.ll test/Analysis/CostModel/X86/cast.ll test/Analysis/CostModel/X86/cmp.ll test/Analysis/CostModel/X86/i32.ll test/Analysis/CostModel/X86/tiny.ll test/Analysis/CostModel/X86/vectorized-loop.ll
Nadav Rotem
nrotem at apple.com
Wed Dec 5 13:21:27 PST 2012
Author: nadav
Date: Wed Dec 5 15:21:26 2012
New Revision: 169423
URL: http://llvm.org/viewvc/llvm-project?rev=169423&view=rev
Log:
Cost Model: change the default cost of control flow instructions (br / ret / ...) to zero.
Modified:
llvm/trunk/lib/Target/TargetTransformImpl.cpp
llvm/trunk/test/Analysis/CostModel/X86/arith.ll
llvm/trunk/test/Analysis/CostModel/X86/cast.ll
llvm/trunk/test/Analysis/CostModel/X86/cmp.ll
llvm/trunk/test/Analysis/CostModel/X86/i32.ll
llvm/trunk/test/Analysis/CostModel/X86/tiny.ll
llvm/trunk/test/Analysis/CostModel/X86/vectorized-loop.ll
Modified: llvm/trunk/lib/Target/TargetTransformImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetTransformImpl.cpp?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetTransformImpl.cpp (original)
+++ llvm/trunk/lib/Target/TargetTransformImpl.cpp Wed Dec 5 15:21:26 2012
@@ -283,7 +283,7 @@
}
unsigned VectorTargetTransformImpl::getCFInstrCost(unsigned Opcode) const {
- return 1;
+ return 0;
}
unsigned VectorTargetTransformImpl::getCmpSelInstrCost(unsigned Opcode,
Modified: llvm/trunk/test/Analysis/CostModel/X86/arith.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/arith.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/arith.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/arith.ll Wed Dec 5 15:21:26 2012
@@ -14,7 +14,7 @@
%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 @@
%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
}
Modified: llvm/trunk/test/Analysis/CostModel/X86/cast.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/cast.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/cast.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/cast.ll Wed Dec 5 15:21:26 2012
@@ -28,7 +28,7 @@
;CHECK: cost of 0 {{.*}} trunc
%H = trunc i32 undef to i1
- ;CHECK: cost of 1 {{.*}} ret
+ ;CHECK: cost of 0 {{.*}} ret
ret i32 undef
}
Modified: llvm/trunk/test/Analysis/CostModel/X86/cmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/cmp.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/cmp.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/cmp.ll Wed Dec 5 15:21:26 2012
@@ -35,7 +35,7 @@
;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
}
Modified: llvm/trunk/test/Analysis/CostModel/X86/i32.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/i32.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/i32.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/i32.ll Wed Dec 5 15:21:26 2012
@@ -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
Modified: llvm/trunk/test/Analysis/CostModel/X86/tiny.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/tiny.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/tiny.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/tiny.ll Wed Dec 5 15:21:26 2012
@@ -4,7 +4,7 @@
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
Modified: llvm/trunk/test/Analysis/CostModel/X86/vectorized-loop.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/CostModel/X86/vectorized-loop.ll?rev=169423&r1=169422&r2=169423&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/CostModel/X86/vectorized-loop.ll (original)
+++ llvm/trunk/test/Analysis/CostModel/X86/vectorized-loop.ll Wed Dec 5 15:21:26 2012
@@ -41,7 +41,7 @@
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 @@
;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
}
More information about the llvm-commits
mailing list