Age | Commit message (Collapse) | Author |
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18153009
|
|
Have nacl-file include "pnacl.h" from the nacl repo, instead
of from the toolchain's standard include locations, so that
it can be moved out of the toolchain tarball and not
advertise it to normal developers.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3525
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18178007
|
|
Disallow i1 on loads/stores and require the conversions to i8 to be
explicit. Add a pass, PromoteI1Ops, that adds the conversions.
(Load/store on i1 occur in practice in small_tests for some boolean
globals.)
Disallow i1 for most arithmetic/comparison operations since these
aren't very useful and it's a nuisance for a code generator to have to
support these. I haven't seen these occur in practice, but
PromoteI1Ops nevertheless expands them.
We still allow and/or/xor on i1 because these do occur in practice,
and they're less of a nuisance to handle because they never overflow:
no truncation to 1 bit is required, unlike with adds.
Restrict the type of alloca's argument. Clang always uses i32 here.
Disallow i1 in switch instructions. Clang doesn't generate i1
switches for booleans.
Move CopyLoadOrStoreAttrs() helper into a header to reuse.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3490
TEST=PNaCl toolchain trybots + GCC torture tests + Spec2k
Review URL: https://codereview.chromium.org/17356011
|
|
We already always provide -mptriple to pnacl-llc, and it's nonsensical to run it without it because pexe don't contain a triple.
BUG=None
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/17617002
|
|
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
|
|
No changes in functionality. Specific cleanups:
* Use OwningPtr instead of bare pointer for FDOut
* Command-line help should say pnacl-llc instead of a generic llvm message
* Remove support for "skip module" feature
* Remove some LOCALMOD comments
* Add link to issue for TODO about timing IR parsing
BUG=None
R=jvoung@chromium.org, kschimpf@google.com
Review URL: https://codereview.chromium.org/17101032
|
|
Until there is an intrinsic to *set* the rounding mode,
this intrinsic to *get* the rounding mode isn't so useful.
Separately we will add a test that for each platform, the
initial rounding mode is "1" (round to nearest). That is
the case right now for x86, ARM, and MIPS.
(see https://codereview.chromium.org/16785003/)
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3491
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17229007
|
|
Change pnacl-llc.cpp to enable the verifier. This causes two problems
which we fix:
* The ABI check for declared-but-not-defined functions fails in
streaming mode. Fixing this would involve changing the bitcode
reader. For now, disable this check when in streaming mode. Add a
flag to PNaClABIVerifyModule.
* ARM's GlobalMerge pass modifies functions' global variable
references to use ConstantExprs that the ABI checker rejects.
Address this by disabling GlobalMerge for now.
GlobalMerge does not provide much benefit at the moment anyway,
because, with the FlattenGlobals pass applied, GlobalMerge doesn't
merge variables with alignment >1.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3465
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17190002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3469
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/17295004
|
|
tools/llc is reset to revision 279b9184c2ff4fea93b198a3519b8cb3a1d8d195
from which the last LLVM merge was made. NaCl-specific files are
removed.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16510008
|
|
BUG=None
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/16663008
|
|
BUG=None
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/16123031
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3485
R=kschimpf@google.com
Review URL: https://codereview.chromium.org/16146012
|
|
We always build the sandboxed translator with NACL_SRPC.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16667016
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3479
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/16440008
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3469
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/16385002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15907008
|
|
Add a pass, StripAttributes, for doing this, and enable it.
Add an ABI check to reject these attributes.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2346
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3415
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/16325025
|
|
Also removes flag from llvm-as.cpp and LTOCodeGenerator.cpp
since one should call pnacl-finalize to
transform pexe's to PNaCl bitcode form.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3469
R=dschuff@chromium.org, jvoung@chromium.org
Review URL: https://codereview.chromium.org/16295014
|
|
Clang's implementation of C++ method pointers generates IR that uses
LLVM registers with struct type -- specifically, loads and stores of
struct values, and extractvalue instructions. See
lib/CodeGen/ItaniumCXXABI.cpp in Clang. Add a pass, ExpandStructRegs,
which expands out those uses.
Factor out a function from ExpandArithWithOverflow so that the two
passes can share some code.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=*.ll tests + trybots + GCC torture tests
Review URL: https://codereview.chromium.org/15692014
|
|
This widens i1, i8 and i16 function arguments and return types.
Factor out RecreateFunction() helper function from existing PNaCl
passes since this is a reoccurring code fragment.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3342
TEST=*.ll tests + PNaCl toolchain trybots + GCC torture tests + LLVM test suite
Review URL: https://codereview.chromium.org/15971007
|
|
i686 translator build fails otherwise, not finding the symbols for passes invoked by llc.
This breakage was introduced by commit ffc13bcb40d4257202295fc0ffe25b38bdf64263
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/15786007
|
|
It turned out that umul.with.overflow wasn't the only *.with.overflow
intrinsic usage introduced by Clang.
I knew that Clang's CGExprCXX.cpp generates umul.with.overflow for an
overflow check for C++'s "new Foo[]". The same code for handling "new
Foo[]" also generates uadd.with.overflow in some cases. This happens
if class Foo has a destructor or a delete[] operator that takes a size
argument. In those cases, the C++ ABI adds a "cookie" to the
allocation which contains the array's size.
Rename the pass to "ExpandArithWithOverflow" and rename files
accordingly.
Also enable the pass.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3434
TEST=*.ll tests + trybots + GCC torture tests
Review URL: https://codereview.chromium.org/15688011
|
|
to external function calls during the translation stage (llc).
One of the passes is a ModulePass that adds the appropriate function
declarations to the module. The other is a FunctionPass that performs the
actual call replacement. This split exists because of bitcode streaming.
Initially the passes handle the llvm.nacl.{set|long}jmp intrinsics. In the
future they may handle additional intrinsics that are part of the PNaCl
stable bitcode ABI.
This CL also removes the previous approach to handling this conversion
(in SelectionDAGBuilder.cpp). That ended up not working - more details in
issue 3429.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/16047002
|
|
These meta-passes will be used to replace the pass lists that are
currently in the pnacl-ld.py driver script in the NaCl repo.
I've moved the comments across from pnacl-ld.py and added a couple
more comments for ExpandByVal and StripMetadata.
Fix the declaration of createResolveAliasesPass().
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3435
TEST=new *.ll tests + tested with change to pnacl-ld.py
Review URL: https://codereview.chromium.org/15669002
|
|
This adds a pass, ExpandMulWithOverflow, to expand out the
llvm.umul.with.overflow calls that Clang generates to implement an
overflow check for C++'s new[] operator.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3434
TEST=expand-mul-with-overflow.ll
Review URL: https://codereview.chromium.org/14649027
|
|
Adds command line option '-pnacl-freeze' to generate a pnacl bit code file
instead of an llvm bitcode file.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15178005
|
|
[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
|
|
ReplacePtrsWithInts converts IR to a normal form in which functions
don't reference any aggregate pointer types and pointer types only
appear inside a few instructions.
Change BlockAddress::replaceUsesOfWithOnConstant() to handle changing
a function's type by replacing a function with a bitcast ConstantExpr
of a new function.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3343
TEST=replace-ptrs-with-ints.ll + PNaCl toolchain trybots, torture tests, etc.
Review URL: https://codereview.chromium.org/14262011
|
|
NaClRecordObjectInformation, and this initialization has to be reinstated.
BUG=None
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/15451003
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14604011
|
|
with stable bitcode intrinsics.
Starting with setjmp and longjmp.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3429
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/14617017
|
|
This pass (mostly) legalizes integer types by promoting them.
It has some limitations (e.g. it can't change function types)
but it is more than sufficient for what clang and SROA generate.
A more significant limitation of promotion is that packed
bitfields of size > 64 bits are still not handled. There are
none in our tests (other than callingconv_case_by_case which
doesn't require a stable pexe) but we will want to either
handle them by correctly expanding them, or find a better way
to error out.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3360
R=eliben@chromium.org, jvoung@chromium.org
Review URL: https://codereview.chromium.org/14569012
|
|
This is needed to switch the native linker to one based on upstream binutils
2.23
R=mseaborn@chromium.org
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2971
also related to bug https://code.google.com/p/nativeclient/issues/detail?id=3424
Review URL: https://codereview.chromium.org/15067009
|
|
This IR pass for ARM inserts a comparison and a branch to trap if the
denominator of a DIV or REM instruction is zero. This makes ARM fault
identically to x86 in this case.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2833
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/14607004
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/15013003
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/14642019
|
|
Change the gatherModuleForLinking interface to return void,
and add a default case in setMergedModuleOutputFormat to silence gcc warning.
BUG=cleanup
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/14582019
|
|
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
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3405
Review URL: https://codereview.chromium.org/14322020
|
|
It wasn't even attempting to build before.
R=jvoung@chromium.org
BUG=cmake/ninja build
Review URL: https://codereview.chromium.org/13844019
|
|
Disallow all metadata by default. There is a flag "-allow-debug-metadata",
which will be used in pnacl-ld driver, to not change the debugging workflow.
That flag will not be present in the pnacl-abicheck driver though.
We'll also run -strip-metadata within pnacl-ld, after optimizations are run,
so that at least that part is checked inside pnacl-ld.
CL for driver changes:
https://codereview.chromium.org/14358048/
BUG= http://code.google.com/p/nativeclient/issues/detail?id=3348
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/14329025
|
|
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
|
|
This pass expands out the "byval" and "sret" argument attributes.
This will affect the calling conventions for PPAPI under PNaCl (for
passing PP_Var etc. by value), so the PNaCl PPAPI shims will need to
be updated in order to enable this pass by default.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3400
TEST=PNaCl toolchain trybots + GCC torture tests + LLVM test suite + Spec2k
Review URL: https://codereview.chromium.org/13973018
|
|
This pass converts initializers for global variables into a flattened
normal form which removes nested struct types and simplifies
ConstantExprs.
In the future, we might change the bitcode format to use the flattened
bytes+relocs representation for global initializers. In that case, we
will be able to reuse the FlattenedConstant class in the bitcode
reader/writer for converting to and from this form.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3113
TEST=test/Transforms/NaCl/flatten-globals.ll
Review URL: https://codereview.chromium.org/14017011
|
|
naming to better match upstream
R=jvoung@chromium.org
BUG=bot LLVM roll
Review URL: https://codereview.chromium.org/14315012
|
|
Clean up the LLVMBuild and CMakeLists.txt files
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/14328017
|
|
Avoid truncation problems. On Unix, exit(256) is equivalent to exit(0).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=none
Review URL: https://codereview.chromium.org/13375007
|
|
This allows the ABI checker passes to be used in the same way as
LLVM's "-verify" pass. It allows the checker to be run between other
passes, and without launching pnacl-abicheck as a separate process (so
without the overhead of reading bitcode into memory again).
Make the ABI checker passes produce fatal errors by default, to match
"-verify". This is overridden for pnacl-abicheck's use.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2309
TEST=tested with pnacl-ld.py changes to use the ABI checker passes
Review URL: https://codereview.chromium.org/13323006
|
|
This only works on instruction attachments for now. Since it is a
ModulePass we can add something to strip NamedMetadata
based on a whitelist, if we want to retain some of that.
It does not touch debug metadata, and leaves -strip-debug to handle that.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3348
Review URL: https://codereview.chromium.org/12844027
|