summaryrefslogtreecommitdiff
path: root/test/Verifier/token3.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-08-14 05:09:07 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-08-14 05:09:07 +0000
commit2dacece9e2c9db49f31a1e1432604f0411018290 (patch)
tree8f3c5859c30ec5acd1fb5d93e04499f23115785e /test/Verifier/token3.ll
parent20c78979303fa130b35a95387d0f23dcbfcc6006 (diff)
[IR] Add token types
This introduces the basic functionality to support "token types". The motivation stems from the need to perform operations on a Value whose provenance cannot be obscured. There are several applications for such a type but my immediate motivation stems from WinEH. Our personality routine enforces a single-entry - single-exit regime for cleanups. After several rounds of optimizations, we may be left with a terminator whose "cleanup-entry block" is not entirely clear because control flow has merged two cleanups together. We have experimented with using labels as operands inside of instructions which are not terminators to indicate where we came from but found that LLVM does not expect such exotic uses of BasicBlocks. Instead, we can use this new type to clearly associate the "entry point" and "exit point" of our cleanup. This is done by having the cleanuppad yield a Token and consuming it at the cleanupret. The token type makes it impossible to obscure or otherwise hide the Value, making it trivial to track the relationship between the two points. What is the burden to the optimizer? Well, it turns out we have already paid down this cost by accepting that there are certain calls that we are not permitted to duplicate, optimizations have to watch out for such instructions anyway. There are additional places in the optimizer that we will probably have to update but early examination has given me the impression that this will not be heroic. Differential Revision: http://reviews.llvm.org/D11861 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Verifier/token3.ll')
-rw-r--r--test/Verifier/token3.ll8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Verifier/token3.ll b/test/Verifier/token3.ll
new file mode 100644
index 00000000000..2cce6b83e7f
--- /dev/null
+++ b/test/Verifier/token3.ll
@@ -0,0 +1,8 @@
+; RUN: not llvm-as %s -o /dev/null 2>&1 | FileCheck %s
+
+define void @f(token %A, token %B) {
+entry:
+ alloca token
+; CHECK: invalid type for alloca
+ ret void
+}