Age | Commit message (Collapse) | Author |
|
Write out all of PNaCl bitcode headers using a single interface
function.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3720
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/61753017
|
|
Define comparison of bitcode abbreviations so that we can add bitcode
abbreviations to collections.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3720
|
|
Factors out bitcode parser from pnacl-bcanalyzer, so that it can also
be used for PNaCl bitcode to bitcode rewriters.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3720
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/48623003
|
|
Make the reader and writer stricter so that we can be sure we're not
accidentally generating ptrtoint or inttoptr instructions in pexe
files.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=toolchain trybots
Review URL: https://codereview.chromium.org/25607006
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/24232002
|
|
Install a fatal error handler for the translator, which stores the error
string, signals an error to the RPC thread, and terminates the thread
(instead of terminating the whole program). This will cause the error to
go to the Javascript console in Chrome
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3519
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/23753003
|
|
* Removes code that is no longer used because global variables are handled
separately.
* Removes CST_CODE_NULL.
* Adds special abbreviations for constant integer 0, replacing
most of what was lost when CST_CODE_NULL is removed.
* Adds abbreviation for floating point constants.
* Removes CST_CODE_AGGREGATE and CST_CODE_DATA, except for reading
old PNaCl version 1 bitcode files.
* Removes call to ParseConstants() in ParseModule() since the module
block no longer contains a constants block (globals are handled
separately).
* Removes getConstantFwdRef() method, since it is no longer needed.
* Remove ConstantPlaceHolder class, since it is no longer needed.
* Remove ResolvedConstants and ResolveConstantForwardRefs()
from the bitcode reader, since it is no longer needed.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3668
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/23522024
|
|
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
|
|
The type ID for the "label" type is never referenced.
The "label" type was only being added to the type table because
EnumerateType() treats BasicBlock and Value operands the same.
However, the rest of the reader and writer treat BasicBlock operands
specially and not like other Values.
Change some tests to use wildcards for some type IDs. This is so that
I don't have to update all the type ID numbers now that the generated
type tables have changed.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=run small_tests with v2 bitcode format enabled
Review URL: https://codereview.chromium.org/23530031
|
|
The value selector list for switch statements are represented using
ARRAY/VECTOR constants, but this information is not put into the bitcode file.
This CL changes the value enumerator to not emit these constants.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3649
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/23653013
|
|
Don't generate types for elided cast instructions, since they
are never put into the bitcode file. In addition, do not generate
a type id for the types of global variables, because they are never
needed. Don't allow STRUCT_ANON in bitcode files PNaClVersion==2.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3648
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/23455023
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3656
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/23496022
|
|
These blocks are never generated by the PNaCl bitcode writer. The
code for generating them was removed when BitcodeWriter.cpp was copied
to produce NaClBitcodeWriter.cpp in
5712db994c8a4abb8c2512fb2900650f8335af66. The same wasn't done when
BitcodeReader.cpp was copied to produce NaClBitcodeReader.cpp, so we
do this now.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/23598005
|
|
This reverts commit 2302e5d39e2302962d1a0e45d60e00ed47b9b061.
BUG=
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/23827002
|
|
Don't generate types for elided cast instructions, since they
are never put into the bitcode file. In addition, do not generate
a type id for the types of global variables, because they are never
needed. Don't allow and STRUCT records in bitcode files
when PNaClVersion==2.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3648
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/23431008
|
|
Named struct types should not appear in LLVM IR that passes the PNaCl
ABI verifier.
Remove the test struct-types.ll because it no longer passes.
Handling of TYPE_CODE_STRUCT_ANON must remain for now until this issue
is fixed: https://code.google.com/p/nativeclient/issues/detail?id=3648
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/23490018
|
|
Opaque struct types should not appear in LLVM IR that passes the PNaCl
ABI verifier.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/23738002
|
|
The only FP types that PNaCl currently supports are float and double.
Clean up error reporting:
* Convert an assert() to a report_fatal_error().
* Return an error rather than an "undef" value.
* Report the type code value when it is unknown.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/23191009
|
|
The PNaCl ABI verifier does not allow large integer constants.
Remove an argument from EmitAPInt() which is now no longer used.
Also make error reporting for unknown Constants more verbose.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/22903044
|
|
This also should complete the changes associated with removing pointer cast
instructions from the PNaCl bitcode file.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=dschuff@chromium.org, jvoung@chromium.org
Review URL: https://codereview.chromium.org/23482002
|
|
PNaCl uses TYPE_CODE_FUNCTION instead, as you'd expect.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/22819015
|
|
These are no longer used since we introduced the GLOBALVAR block for
PNaCl, in which global variable initialisers are flattened.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/22903045
|
|
Removes ptrtoint instructions when applicable (currently only in stores), and add them back just before their use.
Note: This code does not handle ptrtoint casts for calls and phi nodes, binary operators, etc. because handling of casts for these instructions has not been added yet.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/22633002
|
|
Fixes so that the volatile bit is no longer put into the bitcode file,
since the volatile bit is not in the PNaCl ABI.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3610
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/21949006
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/21964002
|
|
Elides inttoptr casts used (exclusively) in load instructions when
PNaClVersion=2. This is an incremental start on removing the inttoptr
instruction from the PNaCl wire format (See issue 3544 for more information
on the strategy of removing ptrtoint).
Also modifies PNaCl bitcode reader/writer to accept PNaClVersion=1 as supported,
and PNaClVersion=2 as unsupported but readable (allowing pnacl-freeze and
pnacl-thaw to work on such files).
Also allows command-line option --pnacl-version for setting PNaClVersion in the
PNaCl bitcode writer.
Also fixes some problems on PNaCl bitcode headers, using common support to
determine when the read/written PNaCl bitcode file is valid.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/5812155903377408
|
|
The PNaCl bitcode writer doesn't generate certain forms of instructions that
the PNaCl bitcode writer accepts. Since these instructions do not get
generated, remove them from the bitcode reader.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/20442002
|
|
Removes block address constants because they are not part of the PNaClABI.
Suggested in CL https://codereview.chromium.org/20172002
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/20402002
|
|
VAArg
Invoke
GetElementPtr
LandingPad
Resume
IndirectBr
ExtractElement
InsertElement
ShuffleVector
ExtractValue
InsertValue
AtomicCmpXchg
AtomicRMW
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/20124002
|
|
reader/writer, since they can't appear in PNaCl bitcode.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/20172002
|
|
Modifies PNaCl bitcode reader/writer to accept PNaClVersion=1 as supported,
and all other versions are unsupported and unreadable. The PNaCl bitcode
reader/writer will generate appropriate messages (including what version
is unsupported if applicable).
Also allows command-line option --pnacl-version for setting the PNaClVersion
in the PNaCl bitcode writer.
Also fixes some problems on PNaCl bitcode headers, using common support to
determine when the read/written PNaCl bitcode file is valid.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19400002
|
|
Remove dead code for:
(1) Top-level inline assembly.
(2) Remove code for named sections.
(3) Remove code for GC names.
(4) Global variable aliases.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18770005
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18042006
|
|
Generates simple global variable records, followed by list of records defining
byte initialization and relocations.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3504
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18111002
|
|
Despite removing metadata at the IR level, the writer was still
outputting a METADATA_BLOCK containing built-in strings such as "dbg",
"tbaa" and "fpmath".
Remove this by removing metadata support from the reader and writer.
I've removed most references to "metadata" and "MD".
I've also removed DEBUG_LOC handling, since that depends on
MDValueList in the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3518
TEST=PNaCl toolchain trybots + check hello_world.final.pexe in bcanalyzer
Review URL: https://codereview.chromium.org/17761005
|
|
For some reason, the size operand of "alloca" was represented using an
absolute value ID + type, unlike other instructions where relative
value IDs are used.
Change the "alloca" representation to be consistent with other
instructions, so that we can use PushValueAndType() in the writer and
getValue() in the reader.
Also take this opportunity to remove the field for alloca's result
type, since it's always i8* in PNaCl.
This is part of a cleanup to make forward reference handling stricter:
it removes a use of getOrCreateFnValueByID(), which isn't strict (that
is, it doesn't reject duplicate FORWARDTYPEREF records).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17757004
|
|
PNaCl only supports a fixed data layout, so treat this as implicit in
the pexe file.
Add the data layout field back at read time, to prevent accidentally
using any architecture-specific backend data layout when translating,
and to ensure that any IR passes that use the data layout work
correctly.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3505
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17591014
|
|
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
|
|
Currently, the triple that gets put into pexes is
"armv7-none-linux-gnueabi". This is a wart that we don't want to
keep. We can remove the triple entirely; PNaCl doesn't need it.
We don't need to add a triple back at read time: (pnacl-)llc tells the
backend explicitly what target to use.
I'm leaving MODULE_CODE_TRIPLE defined in the enum for now because
pnacl-bcanalyzer still refers to it.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3505
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17321009
|
|
I missed updating the comments about the bitcode format in
NaClLLVMBitCodes.h in my previous change.
Note that the comment for FUNC_CODE_INST_CALL was out of date before:
it was missing "cc" (calling conventions).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3506
TEST=none
Review URL: https://codereview.chromium.org/17516004
|
|
Creates a bitcode-local enumeration for calling conventions for the PNaCl bitcode file, so that the bitcode file is better protected from (accidental) changes in LLVM code.
Also removes invokes from the bitcode.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3497
R=dschuff@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17118002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16836017
|
|
Fixes bug where we computed the length of fields buffer on the size of a pointer, rather then the actual length of the field.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3485
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/17003002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15907008
|
|
[1] Explicitly enumerate all abbreviation values, including the
maximum abbreviation for each type of block.
[2] Make "enter subblock" calculate number of bits needed by passing
in maximum abbreviation (associated with block) rather than requiring
the developer to compute this value every time a subblock is entered.
*NOTE* This code changes encoding sizes to be based on
the maximum allowed value, rather than requiring the
developer to calculate out the number of bits needed. This
change doesn't make the PNaCL bitcode files
incompatable with LLVM bitcode files, since it does
not effect the bitcode reader.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14813032
|
|
Create NaCl specific version of BitCodes.h so that we can custimize it
for the PNaCl wire format. Moves enums to namespace naclbitc. Renames
classes using NaCl prefix. Fixes references so that files compiles.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14682013
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14569006
|
|
Copy classes for LLVM BitcodeReader into a NaCl subdirectory, to create a wire
format version. Renames classes/functions to include NaCl prefix, so that
they don't conflict with the LLVM Bitcode reader.
Also implements pnacl-thaw, showing that we can read the PNaCl wire format
files.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14314016
|
|
Copy classes for LLVM BitcodeWriter into a PNaCL subdirectory, to create a
PNaCL version. Renames classes/methods to include PNaCl prefix so that they
don't conflict with the LLVM BitcodeWriter.
Also removed experimental support for use-list order
preservation.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3405
Review URL: https://codereview.chromium.org/14126011
|