diff options
author | Mark Seaborn <mseaborn@chromium.org> | 2013-06-24 16:50:07 -0700 |
---|---|---|
committer | Mark Seaborn <mseaborn@chromium.org> | 2013-06-24 16:50:07 -0700 |
commit | 9a2a4d5471baa159bfd4ed793962ec5d0841631b (patch) | |
tree | 7605618b39c12540ff266a53a05cd6c9ab08dfab /docs | |
parent | c6ab023ee092501613e452bb850aa73ba7427857 (diff) |
PNaCl ABI: Disallow built-in multiplication in "alloca" instructions
Simplify the set of "alloca" instructions the ABI verifier allows.
Before this change, we used i8 arrays, such as:
alloca [8 x i8]
After this change, we will just use i8 with an explicit size value, so
that becomes:
alloca i8, i32 8
Allocation of variable-length arrays will require an explicit multiply
instruction. This means that the code generator no longer has to
handle an implicit multiplication in "alloca", reducing the burden on
fast-and-simple code generators a little. This means the PNaCl ABI
doesn't need to specify whether alloca's implicit multiplication
checks for overflow.
This doesn't affect what the backend generates. See
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp, which handles
constant-size AllocaInsts (by filling out StaticAllocaMap) and which
is uses for both -O2 (SelectionDAG) and -O0 (FastISel) translation.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17631004
Diffstat (limited to 'docs')
-rw-r--r-- | docs/PNaClLangRef.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/PNaClLangRef.rst b/docs/PNaClLangRef.rst index 4333bbc77f..45895f499b 100644 --- a/docs/PNaClLangRef.rst +++ b/docs/PNaClLangRef.rst @@ -271,12 +271,12 @@ Only the LLVM instructions listed here are supported by PNaCl bitcode. * ``frem`` * ``alloca`` - The only allowed type for ``alloca`` instructions in PNaCl bitcode is an - array of i8. For example: + The only allowed type for ``alloca`` instructions in PNaCl bitcode + is i8. For example: .. code-block:: llvm - %buf = alloca [4 x i8], align 1 + %buf = alloca i8, i32 8, align 4 * ``load``, ``store`` |