diff options
author | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-09 15:52:43 +0000 |
---|---|---|
committer | Nuno Lopes <nunoplopes@sapo.pt> | 2012-05-09 15:52:43 +0000 |
commit | 01547b3ad2d4d5d6f832ac1b52d697391dcf9a7f (patch) | |
tree | ffca7c0415d5195f5d0e20b9a4c13d9cbc1ae4b4 /llvm/test/CodeGen | |
parent | 13cfa000188c7034be51238e3ded8ee489faf6c4 (diff) | |
download | bcm5719-llvm-01547b3ad2d4d5d6f832ac1b52d697391dcf9a7f.tar.gz bcm5719-llvm-01547b3ad2d4d5d6f832ac1b52d697391dcf9a7f.zip |
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.
llvm-svn: 156473
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r-- | llvm/test/CodeGen/ARM/divmod.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/Generic/crash.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/Generic/objectsize-upgrade.ll | 16 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/2011-05-26-UnreachableBlockElim.ll | 6 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/crash.ll | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/object-size.ll | 8 | ||||
-rw-r--r-- | llvm/test/CodeGen/X86/unreachable-stack-protector.ll | 4 |
7 files changed, 31 insertions, 15 deletions
diff --git a/llvm/test/CodeGen/ARM/divmod.ll b/llvm/test/CodeGen/ARM/divmod.ll index 49c41037578..d5b2d05b403 100644 --- a/llvm/test/CodeGen/ARM/divmod.ll +++ b/llvm/test/CodeGen/ARM/divmod.ll @@ -43,7 +43,7 @@ bb: %3 = load i32* @tabsize, align 4 %4 = srem i32 %cols, %3 %5 = sdiv i32 %cols, %3 - %6 = tail call i32 @llvm.objectsize.i32(i8* null, i1 false) + %6 = tail call i32 @llvm.objectsize.i32(i8* null, i1 false, i32 0) %7 = tail call i8* @__memset_chk(i8* null, i32 9, i32 %5, i32 %6) nounwind br label %bb1 @@ -54,5 +54,5 @@ bb1: ret void } -declare i32 @llvm.objectsize.i32(i8*, i1) nounwind readnone +declare i32 @llvm.objectsize.i32(i8*, i1, i32) nounwind readnone declare i8* @__memset_chk(i8*, i32, i32, i32) nounwind diff --git a/llvm/test/CodeGen/Generic/crash.ll b/llvm/test/CodeGen/Generic/crash.ll index d889389b7c5..805d0ccd864 100644 --- a/llvm/test/CodeGen/Generic/crash.ll +++ b/llvm/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/llvm/test/CodeGen/Generic/objectsize-upgrade.ll b/llvm/test/CodeGen/Generic/objectsize-upgrade.ll new file mode 100644 index 00000000000..8ed80473f7a --- /dev/null +++ b/llvm/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 diff --git a/llvm/test/CodeGen/X86/2011-05-26-UnreachableBlockElim.ll b/llvm/test/CodeGen/X86/2011-05-26-UnreachableBlockElim.ll index 0f18f0969ba..7cd7be88387 100644 --- a/llvm/test/CodeGen/X86/2011-05-26-UnreachableBlockElim.ll +++ b/llvm/test/CodeGen/X86/2011-05-26-UnreachableBlockElim.ll @@ -8,7 +8,7 @@ target triple = "x86_64-apple-macosx10.6.0" @aux_temp = external global %struct.dfa, align 8 -declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readnone +declare i64 @llvm.objectsize.i64(i8*, i1, i32) nounwind readnone declare void @__memset_chk() nounwind @@ -21,12 +21,12 @@ if.end.i: ; preds = %entry br i1 undef, label %land.end.thread.i, label %land.end.i land.end.thread.i: ; preds = %if.end.i - %0 = call i64 @llvm.objectsize.i64(i8* undef, i1 false) nounwind + %0 = call i64 @llvm.objectsize.i64(i8* undef, i1 false, i32 0) nounwind %cmp1710.i = icmp eq i64 %0, -1 br i1 %cmp1710.i, label %cond.false156.i, label %cond.true138.i land.end.i: ; preds = %if.end.i - %1 = call i64 @llvm.objectsize.i64(i8* undef, i1 false) nounwind + %1 = call i64 @llvm.objectsize.i64(i8* undef, i1 false, i32 0) nounwind %cmp17.i = icmp eq i64 %1, -1 br i1 %cmp17.i, label %cond.false156.i, label %cond.true138.i diff --git a/llvm/test/CodeGen/X86/crash.ll b/llvm/test/CodeGen/X86/crash.ll index cf6e27d1597..35f6ec50bcb 100644 --- a/llvm/test/CodeGen/X86/crash.ll +++ b/llvm/test/CodeGen/X86/crash.ll @@ -203,7 +203,7 @@ entry: ; <rdar://problem/9187792> define fastcc void @func_61() nounwind sspreq { entry: - %t1 = tail call i64 @llvm.objectsize.i64(i8* undef, i1 false) + %t1 = tail call i64 @llvm.objectsize.i64(i8* undef, i1 false, i32 0) %t2 = icmp eq i64 %t1, -1 br i1 %t2, label %bb2, label %bb1 @@ -214,7 +214,7 @@ bb2: ret void } -declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readnone +declare i64 @llvm.objectsize.i64(i8*, i1, i32) nounwind readnone ; PR10277 ; This test has dead code elimination caused by remat during spilling. diff --git a/llvm/test/CodeGen/X86/object-size.ll b/llvm/test/CodeGen/X86/object-size.ll index 8f1eabde742..5120b4caee0 100644 --- a/llvm/test/CodeGen/X86/object-size.ll +++ b/llvm/test/CodeGen/X86/object-size.ll @@ -10,7 +10,7 @@ target triple = "x86_64-apple-darwin10.0" define void @bar() nounwind ssp { entry: %tmp = load i8** @p ; <i8*> [#uses=1] - %0 = call i64 @llvm.objectsize.i64(i8* %tmp, i1 0) ; <i64> [#uses=1] + %0 = call i64 @llvm.objectsize.i64(i8* %tmp, i1 0, i32 0) ; <i64> [#uses=1] %cmp = icmp ne i64 %0, -1 ; <i1> [#uses=1] ; X64: movabsq $-1, [[RAX:%r..]] ; X64: cmpq $-1, [[RAX]] @@ -19,7 +19,7 @@ entry: cond.true: ; preds = %entry %tmp1 = load i8** @p ; <i8*> [#uses=1] %tmp2 = load i8** @p ; <i8*> [#uses=1] - %1 = call i64 @llvm.objectsize.i64(i8* %tmp2, i1 1) ; <i64> [#uses=1] + %1 = call i64 @llvm.objectsize.i64(i8* %tmp2, i1 1, i32 0) ; <i64> [#uses=1] %call = call i8* @__strcpy_chk(i8* %tmp1, i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i64 %1) ssp ; <i8*> [#uses=1] br label %cond.end @@ -33,7 +33,7 @@ cond.end: ; preds = %cond.false, %cond.t ret void } -declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readonly +declare i64 @llvm.objectsize.i64(i8*, i1, i32) nounwind readonly declare i8* @__strcpy_chk(i8*, i8*, i64) ssp @@ -47,7 +47,7 @@ entry: %tmp = load i8** %__dest.addr ; <i8*> [#uses=1] %tmp1 = load i8** %__src.addr ; <i8*> [#uses=1] %tmp2 = load i8** %__dest.addr ; <i8*> [#uses=1] - %0 = call i64 @llvm.objectsize.i64(i8* %tmp2, i1 1) ; <i64> [#uses=1] + %0 = call i64 @llvm.objectsize.i64(i8* %tmp2, i1 1, i32 0) ; <i64> [#uses=1] %call = call i8* @__strcpy_chk(i8* %tmp, i8* %tmp1, i64 %0) ssp ; <i8*> [#uses=1] store i8* %call, i8** %retval %1 = load i8** %retval ; <i8*> [#uses=1] diff --git a/llvm/test/CodeGen/X86/unreachable-stack-protector.ll b/llvm/test/CodeGen/X86/unreachable-stack-protector.ll index b066297ff1b..cc34b9a6045 100644 --- a/llvm/test/CodeGen/X86/unreachable-stack-protector.ll +++ b/llvm/test/CodeGen/X86/unreachable-stack-protector.ll @@ -2,13 +2,13 @@ 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" target triple = "x86_64-apple-darwin10.0.0" -declare i64 @llvm.objectsize.i64(i8*, i1) nounwind readnone +declare i64 @llvm.objectsize.i64(i8*, i1, i32) nounwind readnone define void @test5() nounwind optsize noinline ssp { entry: ; CHECK: movq ___stack_chk_guard@GOTPCREL(%rip) %buf = alloca [64 x i8], align 16 - %0 = call i64 @llvm.objectsize.i64(i8* undef, i1 false) + %0 = call i64 @llvm.objectsize.i64(i8* undef, i1 false, i32 0) br i1 false, label %if.end, label %if.then if.then: ; preds = %entry |