Age | Commit message (Collapse) | Author |
|
Patch by: Vincent Lejeune
https://bugs.freedesktop.org/show_bug.cgi?id=64877
NOTE: This is a candidate for the 3.3 branch.
Merged from r182600
Author: Tom Stellard <thomas.stellard@amd.com>
Date: Thu May 23 18:26:42 2013 +0000
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_33@185868 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
Instead, defer the undefined behavior to runtime.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3537
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18552007
|
|
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
|
|
(1) Fix spacing in header of record histogram so that columns line up.
(2) Only print 8 operands per line in the dump. Keeps lines from getting
too long.
BUG=None
R=jvoung@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18147006
|
|
On the hardware that we support, they are implemented
by instructions and have consistent behavior for -0.0,
values less than -0.0, infinity, and nan.
We will need to be careful to guarantee the same behavior
for untested hardware.
TEST=run_llvm_math_intrinsics_test
BUG=http://code.google.com/p/nativeclient/issues/detail?id=3378
R=jfb@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18559005
|
|
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
|
|
BUG=None
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18543004
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3339
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18426002
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3532
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18348008
|
|
This makes the checker stricter, so that it will reject names such as
"@llvm.memcpy.foo".
Reuse Intrinsic::getName() and Intrinsic::getType() for checking the
exact function name and type that we should expect for whitelisted
intrinsics. This is simpler than writing code to check each argument
type separately.
intrinsics.ll test: Add some tests. Simplify existing tests by
replacing multiple CHECK-NOTs with a single "CHECK-NOT: disallowed",
which is stricter because it is less specific.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3530
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/18302002
|
|
Removing some code and comments that aren't needed.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18348005
|
|
Convert calls to this intrinsic to use the 32-bit variant instead. Do
the same for the memcpy and memmove intrinsics too.
Change the PNaCl ABI verifier to check this argument.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3530
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/18226003
|
|
The stacksave/restore intrinsics are covered by
"run_vla_test", tests in GCC torture testsuite, and
basic llvm lit tests (mostly related to debug info...).
The pow intrinsic is no longer needed after Eli's
change to Clang, and pow is done purely in libm
(even with -fno-math-errno).
BUG=http://code.google.com/p/nativeclient/issues/detail?id=3378
R=eliben@chromium.org, jfb@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18180002
|
|
This is no longer required, following our recent PNaCl ABI cleanups.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18031017
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18153009
|
|
In a subsequent CL I'll clean up the whole IntrinsicLowering logic - probably
reverting it to upstream since we no longer really use it.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3526
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18053017
|
|
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
|
|
This is no longer required, since Clang will not generate llvm.pow.*
intrinsics.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3513
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/18162002
|
|
Before this change, NaClBitcodeReader had some icky use of C++
function overloading and reference types. Whether getValue() modified
its Slot argument depended on whether it was passed a Type argument,
which wasn't very readable:
// Modifies Slot.
bool getValue(SmallVector<uint64_t, 64> &Record, unsigned &Slot,
unsigned InstNum, Value *&ResVal);
// Does not modify Slot.
bool getValue(SmallVector<uint64_t, 64> &Record, unsigned Slot,
unsigned InstNum, Type *Ty, Value *&ResVal);
// Does not modify Slot.
Value *getValue(SmallVector<uint64_t, 64> &Record, unsigned Slot,
unsigned InstNum, Type *Ty);
So, do these cleanups:
* Convert non-const reference arguments to pointers. (Also add
"const" to the Record argument.)
* Remove the unused Type argument from getValue()/popValue().
* Remove the getValue() case that was identical to popValue(). Call
popValue() instead. Now popValue() modifies *Slot and getValue()
does not.
* Remove an unused getValue() case.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17938002
|
|
Change the reader to be stricter so that duplicate FORWARDTYPEREFs are
rejected.
Also fix typo in error message.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=see "Invalid FORWARDTYPEREF record" if EmitFnForwardTypeRef()
is changed to produce unnecessary FORWARDTYPEREFs
Review URL: https://codereview.chromium.org/17925002
|
|
These were for ELF dynamic linking support, which we are removing.
The same LOCALMODs were previously removed from PNaCl's fork of the
reader/writer (in https://codereview.chromium.org/17761005/).
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3520
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17854006
|
|
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
|
|
Before this change, the writer would only emit FORWARDTYPEREF for some
operands, e.g. the first operand of BINOP but not the second, on the
grounds that the type of the second operand can be inferred. However,
that makes the format complicated.
Change the writer so that it always emits FORWARDTYPEREF for a forward
ref. This unifies PushValueAndType() and pushValue(). pushValue()
gains a call to EmitFnForwardTypeRef() so becomes the same as
PushValueAndType().
Change the reader to be stricter, so that it requires a FORWARDTYPEREF
to have been emitted in most cases. This is done by ignoring the
implied type argument.
Tasks still remaining:
* Make reader stricter so that multiple FORWARDTYPEREFs are disallowed.
* Remove now-unused Type arguments in the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=new llvm-lit test + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17806003
|
|
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
|
|
The magic number is no longer needed now that the reader for the old
switch representation has been removed (in
https://codereview.chromium.org/17764003), so we can remove this
baggage.
Also add a missing record size check to the reader.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3507
TEST=hello_world.pexe includes a switch statement; also PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17777005
|
|
The PNaCl pexe writer never writes this old representation.
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/17764003
|
|
* Don't preserve external linking for mem{cpy,move,cmp} during LTO.
* In the RewritePNaClLibraryCalls pass - add rewriting of mem* calls to
appropriate intrinsics, similarly to the way it was done for longjmp.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3493
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17622003
|
|
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
|
|
The code is similar to the case for handling phi nodes.
It turns out that "select" on struct values can occur in practice with
use of C++ method pointers.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3514
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17706002
|
|
Revert this until we fix i1 sext. Currently, it uses LSL and ASR,
which are pseudo-instructions and get dropped on the floor when
generating .o files. We'll fix that, but for now revert to green
the bots.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3501
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/17715002
|
|
The use of StripDeadPrototypes in PNaClABISimplify.cpp wasn't always
having an effect: it doesn't work if there are dead constant
references remaining to a function declaration. ReplacePtrsWithInts
was leaving some of these references behind, so fix it.
BUG=none
TEST=llvm-lit tests
Review URL: https://codereview.chromium.org/17636006
|
|
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
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3338
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3415
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/17633003
|
|
Do the same for memcpy/memmove/memset intrinsic calls that we have
already done for integer loads and stores: Remove assumptions about
pointer alignment by setting the alignment argument to 1. Make the
ABI checker require this.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3445
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17563008
|
|
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
|
|
Disallow the other input types.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3378
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/17613002
|
|
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
|
|
This change will fix the regression in -O0 translation time caused by
putting "align 1" on integer loads and stores, which was causing
FastISel to fall back to SelectionDAG more often.
> In X86FastISel::X86SelectStore(), improperly aligned stores are
> rejected and handled by the DAG-based ISel. However,
> X86FastISel::X86SelectLoad() makes no such requirement. There
> doesn't appear to be an x86 architectural correctness issue with
> allowing potentially unaligned store instructions. This patch
> removes this restriction.
>
> Patch by Jim Stichnot.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3445
TEST=PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17575003
|
|
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
|
|
PnaclRef.rst is an initial reference manual for PNaCl bitcode. It's
using the same documentation system to build as the other LLVM .rst
docs and has multiple links into relevant sections of LangRef.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/17463004
|
|
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
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/17519003
|
|
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/17115012
|
|
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
|
|
Change the ABI verifier to require "align 1" on non-atomic integer
accesses to prevent non-portable behaviour. Allow larger alignments
on floating point accesses as a concession to performance, because ARM
might not be able to do unaligned FP loads/stores efficiently.
Change StripAttributes to make pexes pass the ABI verifier.
Also update comments in StripAttributes to match some recent changes.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3445
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17094009
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3415
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/17470005
|
|
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
|