From cd4a14419f49fb236d65e5b69d871d6fc61fcb99 Mon Sep 17 00:00:00 2001 From: Mark Seaborn Date: Thu, 5 Sep 2013 09:41:53 -0700 Subject: 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 --- include/llvm/Bitcode/NaCl/NaClLLVMBitCodes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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 -- cgit v1.2.3-18-g5258