summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2017-09-22 18:25:53 +0000
committerGuozhi Wei <carrot@google.com>2017-09-22 18:25:53 +0000
commitbce228ca427b52a9ac7657a49fa0a56de586e229 (patch)
tree6e76f8c96e2acdbfdf0a301de6cf79a0ad2cceee /llvm/test
parent0acf3434e7e9f1b1ab828ad8e2d1fcf3c537e6b1 (diff)
downloadbcm5719-llvm-bce228ca427b52a9ac7657a49fa0a56de586e229.tar.gz
bcm5719-llvm-bce228ca427b52a9ac7657a49fa0a56de586e229.zip
[TargetTransformInfo] Handle intrinsic call in getInstructionLatency()
Usually an intrinsic is a simple target instruction, it should have a small latency. A real function call has much larger latency. So handle the intrinsic call in function getInstructionLatency(). Differential Revision: https://reviews.llvm.org/D38104 llvm-svn: 314003
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Analysis/CostModel/X86/costmodel.ll6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/test/Analysis/CostModel/X86/costmodel.ll b/llvm/test/Analysis/CostModel/X86/costmodel.ll
index d16cc27cb16..19e7128ff44 100644
--- a/llvm/test/Analysis/CostModel/X86/costmodel.ll
+++ b/llvm/test/Analysis/CostModel/X86/costmodel.ll
@@ -5,6 +5,8 @@
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-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
+
define i64 @foo(i64 %arg) {
; LATENCY: cost of 0 {{.*}} alloca i32
@@ -39,6 +41,10 @@ define i64 @foo(i64 %arg) {
; CODESIZE: cost of 0 {{.*}} trunc
%TC = trunc i64 undef to i32
+ ; LATENCY: cost of 1 {{.*}} call
+ ; CODESIZE: cost of 1 {{.*}} call
+ %uadd = call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 undef, i32 undef)
+
; LATENCY: cost of 1 {{.*}} ret
; CODESIZE: cost of 1 {{.*}} ret
ret i64 undef
OpenPOWER on IntegriCloud