diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-09-05 09:41:53 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-09-05 09:41:53 -0700 |
commit | cd4a14419f49fb236d65e5b69d871d6fc61fcb99 (patch) | |
tree | ddb320f736845f4aa93ef3ab42400f1fbf69584e /include | |
parent | 1180f259c88b1eb1000d0aaf5753b3da9f8e4e51 (diff) |
PNaCl bitcode: Indirect calls: Store return type instead of function type
For indirect call instructions (INST_CALL_INDIRECT), it's not
necessary to store the full function type. The argument types are
already known from the arguments in the instruction. We only need to
store the return type to be able to reconstruct the full function
type.
Storing only the return type ID will make the bitcode a little more
compact. Return type IDs will be frequently-used scalar types, which
can be given smaller type IDs than function types, which are less
frequently used.
This potentially makes the writer simpler: In principle, the writer no
longer needs to make a pass across all functions' bodies to determine
which function types are used in order to build the type table.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3544
TEST=*.ll tests
Review URL: https://codereview.chromium.org/23521005
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h index 384b03661e..2e3cd21652 100644 --- a/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h +++ b/include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h @@ -331,7 +331,7 @@ namespace naclbitc { FUNC_CODE_INST_LOADATOMIC = 41, // Not used in PNaCl. FUNC_CODE_INST_STOREATOMIC = 42, // Not used in PNaCl. FUNC_CODE_INST_FORWARDTYPEREF = 43, // TYPE: [opval, ty] - // PNaCl version 2+: CALL_INDIRECT: [cc, fnid, fnty, args...] + // PNaCl version 2+: CALL_INDIRECT: [cc, fnid, returnty, args...] FUNC_CODE_INST_CALL_INDIRECT = 44 }; } // End naclbitc namespace |