aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode
diff options
context:
space:
mode:
authorKarl Schimpf <kschimpf@google.com>2013-06-24 12:12:38 -0700
committerKarl Schimpf <kschimpf@google.com>2013-06-24 12:12:38 -0700
commit9bdedeb556e162cecaa79aff339150ea53aae99f (patch)
tree9a8440ecdfd3c06d74e2627c9a4aee2b144de006 /include/llvm/Bitcode
parent41dd5ede22556305aed7ea2184a2905f187db78c (diff)
Simplify representation of forward value references in bitcode.
Simplify instruction records by adding concept of a forward type reference map that maps ValueID's to types. Used to generate forward reference types for instruction arguments that need a type because the forward reference has not yet been generated. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3507 R=jvoung@chromium.org, mseaborn@chromium.org Review URL: https://codereview.chromium.org/16963004
Diffstat (limited to 'include/llvm/Bitcode')
-rw-r--r--include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h42
1 files changed, 22 insertions, 20 deletions
diff --git a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
index 3ad9242bd2..1c4d80efba 100644
--- a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
+++ b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h
@@ -284,19 +284,20 @@ namespace naclbitc {
enum NaClFunctionCodes {
FUNC_CODE_DECLAREBLOCKS = 1, // DECLAREBLOCKS: [n]
- FUNC_CODE_INST_BINOP = 2, // BINOP: [opcode, ty, opval, opval]
- FUNC_CODE_INST_CAST = 3, // CAST: [opcode, ty, opty, opval]
+ FUNC_CODE_INST_BINOP = 2, // BINOP: [opval, opval, opcode
+ // [, flags]]
+ FUNC_CODE_INST_CAST = 3, // CAST: [opval, destty, castopc]
FUNC_CODE_INST_GEP = 4, // GEP: [n x operands]
- FUNC_CODE_INST_SELECT = 5, // SELECT: [ty, opval, opval, opval]
- FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opty, opval, opval]
- FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [ty, opval, opval, opval]
- FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [ty, opval, opval, opval]
- FUNC_CODE_INST_CMP = 9, // CMP: [opty, opval, opval, pred]
+ FUNC_CODE_INST_SELECT = 5, // SELECT: [opval, opval, opval]
+ FUNC_CODE_INST_EXTRACTELT = 6, // EXTRACTELT: [opval, opval]
+ FUNC_CODE_INST_INSERTELT = 7, // INSERTELT: [opval, opval, opval]
+ FUNC_CODE_INST_SHUFFLEVEC = 8, // SHUFFLEVEC: [opval, opval, opval]
+ FUNC_CODE_INST_CMP = 9, // CMP: [opval, opval, pred]
- FUNC_CODE_INST_RET = 10, // RET: [opty,opval<both optional>]
+ FUNC_CODE_INST_RET = 10, // RET: [opval<optional>]
FUNC_CODE_INST_BR = 11, // BR: [bb#, bb#, cond] or [bb#]
FUNC_CODE_INST_SWITCH = 12, // SWITCH: [opty, op0, op1, ...]
- FUNC_CODE_INST_INVOKE = 13, // INVOKE: [attr, fnty, op0,op1, ...]
+ FUNC_CODE_INST_INVOKE = 13, // No longer allowed.
// 14 is unused.
FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
@@ -304,42 +305,43 @@ namespace naclbitc {
// 17 is unused.
// 18 is unused.
FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, op, align]
- FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol]
+ FUNC_CODE_INST_LOAD = 20, // LOAD: [op, align, vol]
// 21 is unused.
// 22 is unused.
FUNC_CODE_INST_VAARG = 23, // VAARG: [valistty, valist, instty]
// This store code encodes the pointer type, rather than the value type
// this is so information only available in the pointer type (e.g. address
// spaces) is retained.
- FUNC_CODE_INST_STORE = 24, // STORE: [ptrty,ptr,val, align, vol]
+ FUNC_CODE_INST_STORE = 24, // STORE: [ptr, val, align, vol]
// 25 is unused.
- FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [n x operands]
- FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [n x operands]
+ FUNC_CODE_INST_EXTRACTVAL = 26, // EXTRACTVAL: [opval, n x indices]
+ FUNC_CODE_INST_INSERTVAL = 27, // INSERTVAL: [opval, opval, n x indices]
// fcmp/icmp returning Int1TY or vector of Int1Ty. Same as CMP, exists to
// support legacy vicmp/vfcmp instructions.
- FUNC_CODE_INST_CMP2 = 28, // CMP2: [opty, opval, opval, pred]
+ FUNC_CODE_INST_CMP2 = 28, // CMP2: [opval, opval, pred]
// new select on i1 or [N x i1]
- FUNC_CODE_INST_VSELECT = 29, // VSELECT: [ty,opval,opval,predty,pred]
+ FUNC_CODE_INST_VSELECT = 29, // VSELECT: [opval, opval, pred]
FUNC_CODE_INST_INBOUNDS_GEP= 30, // INBOUNDS_GEP: [n x operands]
FUNC_CODE_INST_INDIRECTBR = 31, // INDIRECTBR: [opty, op0, op1, ...]
// 32 is unused.
FUNC_CODE_DEBUG_LOC_AGAIN = 33, // DEBUG_LOC_AGAIN
- FUNC_CODE_INST_CALL = 34, // CALL: [cc, fnty, fnid, args...]
+ FUNC_CODE_INST_CALL = 34, // CALL: [cc, fnid, args...]
FUNC_CODE_DEBUG_LOC = 35, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal]
FUNC_CODE_INST_FENCE = 36, // FENCE: [ordering, synchscope]
- FUNC_CODE_INST_CMPXCHG = 37, // CMPXCHG: [ptrty,ptr,cmp,new, align, vol,
+ FUNC_CODE_INST_CMPXCHG = 37, // CMPXCHG: [ptr, cmp, new, align, vol,
// ordering, synchscope]
- FUNC_CODE_INST_ATOMICRMW = 38, // ATOMICRMW: [ptrty,ptr,val, operation,
+ FUNC_CODE_INST_ATOMICRMW = 38, // ATOMICRMW: [ptr,val, operation,
// align, vol,
// ordering, synchscope]
FUNC_CODE_INST_RESUME = 39, // RESUME: [opval]
FUNC_CODE_INST_LANDINGPAD = 40, // LANDINGPAD: [ty,val,val,num,id0,val0...]
- FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [opty, op, align, vol,
+ FUNC_CODE_INST_LOADATOMIC = 41, // LOAD: [op, align, vol,
// ordering, synchscope]
- FUNC_CODE_INST_STOREATOMIC = 42 // STORE: [ptrty,ptr,val, align, vol
+ FUNC_CODE_INST_STOREATOMIC = 42, // STORE: [ptr, val, align, vol
// ordering, synchscope]
+ FUNC_CODE_INST_FORWARDTYPEREF = 43 // TYPE: [opval, ty]
};
enum NaClUseListCodes {