diff options
author | David Majnemer <david.majnemer@gmail.com> | 2015-11-11 21:57:16 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2015-11-11 21:57:16 +0000 |
commit | f0f224d12dc474c144b1a1c1b6864ecc0b768a24 (patch) | |
tree | 45d1ac7149f0a42417cb1491b9c3d3dda344e941 /llvm/lib/Transforms | |
parent | 77f211c1aa2760cdf5f6f72cc490e95f6d0519d6 (diff) | |
download | bcm5719-llvm-f0f224d12dc474c144b1a1c1b6864ecc0b768a24.tar.gz bcm5719-llvm-f0f224d12dc474c144b1a1c1b6864ecc0b768a24.zip |
[IR] Add support for empty tokens
When working with tokens, it is often the case that one has instructions
which consume a token and produce a new token. Currently, we have no
mechanism to represent an initial token state.
Instead, we can create a notional "empty token" by inventing a new
constant which captures the semantics we would like. This new constant
is called ConstantTokenNone and is written textually as "token none".
Differential Revision: http://reviews.llvm.org/D14581
llvm-svn: 252811
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/IPO/MergeFunctions.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/IPO/MergeFunctions.cpp b/llvm/lib/Transforms/IPO/MergeFunctions.cpp index 762741b72bf..bb75ab6ece1 100644 --- a/llvm/lib/Transforms/IPO/MergeFunctions.cpp +++ b/llvm/lib/Transforms/IPO/MergeFunctions.cpp @@ -656,7 +656,9 @@ int FunctionComparator::cmpConstants(const Constant *L, const Constant *R) { } switch (L->getValueID()) { - case Value::UndefValueVal: return TypesRes; + case Value::UndefValueVal: + case Value::ConstantTokenNoneVal: + return TypesRes; case Value::ConstantIntVal: { const APInt &LInt = cast<ConstantInt>(L)->getValue(); const APInt &RInt = cast<ConstantInt>(R)->getValue(); |