summaryrefslogtreecommitdiff
path: root/test/Verifier
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-01-17 23:58:17 +0000
committerReid Kleckner <reid@kleckner.net>2014-01-17 23:58:17 +0000
commit3cbfa1617f0d935d68bf519afb5720df066849c2 (patch)
treebbd9321083451c055f56f050fe08c56d5a35d9f6 /test/Verifier
parent01d9f5972a0d7b0d88f815e6f7424f5f7b5bdb04 (diff)
downloadllvm-3cbfa1617f0d935d68bf519afb5720df066849c2.tar.gz
llvm-3cbfa1617f0d935d68bf519afb5720df066849c2.tar.bz2
llvm-3cbfa1617f0d935d68bf519afb5720df066849c2.tar.xz
Add an inalloca flag to allocas
Summary: The only current use of this flag is to mark the alloca as dynamic, even if its in the entry block. The stack adjustment for the alloca can never be folded into the prologue because the call may clear it and it has to be allocated at the top of the stack. Reviewers: majnemer CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2571 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199525 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier')
-rwxr-xr-xtest/Verifier/inalloca-vararg.ll2
-rw-r--r--test/Verifier/inalloca2.ll22
2 files changed, 21 insertions, 3 deletions
diff --git a/test/Verifier/inalloca-vararg.ll b/test/Verifier/inalloca-vararg.ll
index 6729c42830..8521ebce2d 100755
--- a/test/Verifier/inalloca-vararg.ll
+++ b/test/Verifier/inalloca-vararg.ll
@@ -2,7 +2,7 @@
declare void @h(i32, ...)
define void @i() {
- %args = alloca i32
+ %args = alloca i32, inalloca
call void (i32, ...)* @h(i32 1, i32* inalloca %args, i32 3)
; CHECK: inalloca isn't on the last argument!
ret void
diff --git a/test/Verifier/inalloca2.ll b/test/Verifier/inalloca2.ll
index ed65667dc3..e4e81be386 100644
--- a/test/Verifier/inalloca2.ll
+++ b/test/Verifier/inalloca2.ll
@@ -6,7 +6,7 @@ declare void @doit(i64* inalloca %a)
define void @a() {
entry:
- %a = alloca [2 x i32]
+ %a = alloca [2 x i32], inalloca
%b = bitcast [2 x i32]* %a to i64*
call void @doit(i64* inalloca %b)
ret void
@@ -14,8 +14,26 @@ entry:
define void @b() {
entry:
- %a = alloca i64
+ %a = alloca i64, inalloca
call void @doit(i64* inalloca %a)
call void @doit(i64* inalloca %a)
ret void
}
+
+define void @c(i1 %cond) {
+entry:
+ br i1 %cond, label %if, label %else
+
+if:
+ %a = alloca i64, inalloca
+ br label %call
+
+else:
+ %b = alloca i64, inalloca
+ br label %call
+
+call:
+ %args = phi i64* [ %a, %if ], [ %b, %else ]
+ call void @doit(i64* inalloca %args)
+ ret void
+}