Age | Commit message (Collapse) | Author |
|
The PNaCl bitcode writer had some complex logic for deciding when to
omit casts in the output. This was left over from when the writer was
trying to leave in the casts in some but not all cases (as part of
incrementally removing casts).
This is no longer needed now that the writer just omits all inttoptrs,
all ptrtoints, and all pointer bitcasts.
This cleanup also fixes the writer so that it elides an inttoptr of a
ptrtoint. This sequence is allowed by the PNaCl ABI verifier, but
never occurred in practice because ReplacePtrsWithInts'
SimplifyCasts() function converts this sequence to an equivalent
bitcast. Before this change, the writer would give this error for an
inttoptr-of-ptrtoint:
LLVM ERROR: Illegal (PNaCl ABI) pointer cast : %1 = ptrtoint [4 x i8]* @bytes to i32
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3590
TEST=toolchain trybots
Review URL: https://codereview.chromium.org/25817002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3590
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/24232002
|
|
There are now no uses of pointer type IDs in PNaCl bitcode, so we can
stop outputting pointer types into the type table.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671
TEST=test/NaCl/Bitcode/*.ll
Review URL: https://codereview.chromium.org/23600013
|
|
Before, FORWARDTYPEREFs used i8* type rather than i32 if they
referenced an "alloca" instruction.
Clean this up so that FORWARDTYPEREFs use i32 instead in this case.
Note that this means that a forward-referenced "alloca" can be used
via an ptrtoint+inttoptr, rather than a bitcast, but that's no
problem.
This is a step towards removing TYPE_CODE_POINTER from the types
table, to simplify the PNaCl bitcode format.
Rename NormalizeParamType() to NormalizeScalarType() to reflect that
it's used in more cases; make it public.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671
TEST=test/NaCl/Bitcode/*.ll
Review URL: https://codereview.chromium.org/23719016
|
|
BUG=none
TEST=compile
Review URL: https://codereview.chromium.org/23619020
|
|
Change the writer to strip pointer types from intrinsics' argument and
return types, replacing them with i32. This simplifies the PNaCl
bitcode format so that pointer types don't need to be represented
here.
Change the reader to restore the pointer types so that the intrinsic
declarations pass the LLVM and PNaCl verifiers.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3671
TEST=intrinsic tests in call-elide.ll
+ intrinsic-pointer-args.ll
+ run small_tests with bitcode v2 enabled
Review URL: https://codereview.chromium.org/23793005
|
|
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
|
|
For PNaClVersion==2, removes remaining pointer casts from bitcode files.
This includes:
* Return value can be casted to a scalar value.
* Intrinsic calls may return an inherent pointer, which may
need casting to a scalar value.
Also modifies tests bitcast-elide.ll and inttoptr-elide.ll
by removing tests that assumed there were remaining pointer
bitcasts that do not get removed.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/23524003
|
|
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
|
|
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
|
|
Handles the eliding of pointer to integer casts operands of the phi node.
Also caches unelided casts generated in the reader (removing
duplicates within the same block). This reduces the size of
thawed pnacl-llc.pexe by about 2%.
BUG= https://code.google.com/p/nativeclient/issues/detailid=3544
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/22909016
|
|
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
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/21964002
|
|
Adds the eliding of bitcasts that are used as an argument to
instructions that expect normalized pointers. Currently, the checked
in code only checks normalized pointers for load instructions. Hence,
the restriction to load instructions. As more instructions are
modified to check for normalized pointers, this code will apply
to those instructions.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3544
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/21614002
|
|
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
|
|
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
|
|
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
|
|
Also removed local MaxGlobalType in WriteModuleInfo because it calls VE.getTypeID(GV->getTYpe(), which is no longer defined for globals.
Also noted that MaxAlignment in WriteModuleInfo was no longer used and removed it.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3541
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18185005
|
|
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
|
|
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
|
|
Remove support for reading and writing the PARAMATTR_BLOCK_ID and
PARAMATTR_GROUP_BLOCK_ID blocks.
These blocks will no longer be written into pexes. While PNaCl
doesn't allow function attributes on normal functions,
Function::Create() always inserts them back on intrinsics, so
previously the PARAMATTR blocks were being written into pexes.
Remove paramattr fields from two record types:
* MODULE_CODE_FUNCTION records (function declarations). Also remove
the fields that follow paramattr, which PNaCl also does not use.
* FUNC_CODE_INST_CALL (function calls).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3506
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17419013
|
|
Create type IDs based on number of references, rather than first reached.
This is done so that fewer bits are used to encode types that are commonly
used.
Note that this cuts the size of the generate bitcode file by about 1.5%, with
no effect on the reader, since it only changes the order type ID's are created.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14495008
|
|
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
|