aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Generic
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2012-05-09 15:52:43 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2012-05-09 15:52:43 +0000
commit30759542aa820b9fc74c77bfa3c011cb0a106ef9 (patch)
tree9698461a0cd7c16beea9446415a512f3e3bcde0e /test/CodeGen/Generic
parent80fa4723b9b7cb9d78d71648095e4e2804681402 (diff)
downloadexternal_llvm-30759542aa820b9fc74c77bfa3c011cb0a106ef9.zip
external_llvm-30759542aa820b9fc74c77bfa3c011cb0a106ef9.tar.gz
external_llvm-30759542aa820b9fc74c77bfa3c011cb0a106ef9.tar.bz2
change the objectsize intrinsic signature: add a 3rd parameter to denote the maximum runtime performance penalty that the user is willing to accept.
This commit only adds the parameter. Code taking advantage of it will follow. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156473 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Generic')
-rw-r--r--test/CodeGen/Generic/crash.ll4
-rw-r--r--test/CodeGen/Generic/objectsize-upgrade.ll16
2 files changed, 18 insertions, 2 deletions
diff --git a/test/CodeGen/Generic/crash.ll b/test/CodeGen/Generic/crash.ll
index d889389..805d0cc 100644
--- a/test/CodeGen/Generic/crash.ll
+++ b/test/CodeGen/Generic/crash.ll
@@ -23,7 +23,7 @@ bb32: ; preds = %bb6
%3 = load double* %1, align 4
%4 = load double* %0, align 4
call void @Parse_Vector(double* %0) nounwind
-%5 = call i32 @llvm.objectsize.i32(i8* undef, i1 false)
+%5 = call i32 @llvm.objectsize.i32(i8* undef, i1 false, i32 0)
%6 = icmp eq i32 %5, -1
br i1 %6, label %bb34, label %bb33
@@ -36,7 +36,7 @@ unreachable
}
declare void @Parse_Vector(double*)
-declare i32 @llvm.objectsize.i32(i8*, i1)
+declare i32 @llvm.objectsize.i32(i8*, i1, i32)
; PR9578
diff --git a/test/CodeGen/Generic/objectsize-upgrade.ll b/test/CodeGen/Generic/objectsize-upgrade.ll
new file mode 100644
index 0000000..8ed8047
--- /dev/null
+++ b/test/CodeGen/Generic/objectsize-upgrade.ll
@@ -0,0 +1,16 @@
+; RUN: opt < %s -verify -S | FileCheck %s
+; check automatic upgrade of objectsize. To be removed in LLVM 3.3.
+
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+
+define i32 @foo() nounwind {
+; CHECK: @foo
+ %1 = alloca i8, align 4
+ %2 = getelementptr inbounds i8* %1, i32 0
+; CHECK: llvm.objectsize.i32(i8* %2, i1 false, i32 0)
+ %3 = call i32 @llvm.objectsize.i32(i8* %2, i1 0)
+ ret i32 %3
+}
+
+; CHECK: @llvm.objectsize.i32(i8*, i1, i32)
+declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readonly