Age | Commit message (Collapse) | Author |
|
Prevent sandbox addresses from being written to the stack. This
covers the following cases:
1. Function calls manually push a masked return address and jump to
the target, rather than using the call instruction.
2. When the function prolog chooses to use a frame pointer (rbp), it
saves a masked version of the old rbp.
3. Indirect branches (jumps, calls, and returns) uniformly use r11 to
construct the 64-bit target address.
4. Register r11 is marked as reserved (similar to r15) so that the
register allocator won't inadvertently spill a code address to the
stack.
These transformations can be disabled for performance testing with the
flag "-sfi-hide-sandbox-base=false".
BUG= https://code.google.com/p/nativeclient/issues/detail?id=1235
R=eliben@chromium.org, mseaborn@chromium.org
Review URL: https://codereview.chromium.org/19505003
|
|
Several parts of the already in-place code have been omitted in the previous
merge. These are:
- missing lowering of Intrinsic::nacl_read_tp;
- checks for forbidden instructiosn in branch-delay slots;
- lowering operation for ISD::NACL_TP_TLS_OFFSET and ISD::NACL_TP_TDB_OFFSET.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2275
TEST= run smoke tests
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/19614006
|
|
Post 3.3-merge there seems to be a problem using mmap on cygwin. In the
meantime, as a LOCALMOD, we disable usage of mmap in MemoryBuffer. The
effect of this on the Windows/Cygwin toolchain can be a slightly slower
developer-side linkage time.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3578
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/19923003
|
|
Specifically:
r186489 - Fix ARMFastISel::ARMEmitIntExt shift emission
r183794 - ARM FastISel fix sext/zext fold
r183601 - Fix unused variable warning from my previous patch
r183551 - ARM FastISel integer sext/zext improvements
These should fix some failures that I had run into back then, as well as make ARM FastISel faster because it doesn't go to SelectionDAG.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3501
R=jvoung@chromium.org
TEST= make check-all
Review URL: https://codereview.chromium.org/19992002
|
|
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
|
|
Fix printing of instructions/constants to explicitly check on cast opcodes
and binary operators, so that we don't accidentally allow unknown opcodes.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3570
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19242003
|
|
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=https://code.google.com/p/nativeclient/issues/detail?id=3525
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/19668004
|
|
Following our discussion in the related bug, prefetch will not be part of our initial stable ABI.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3531
TEST= cd ./pnacl/build/llvm_x86_64; ninja check
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19771015
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3349
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/19500012
|
|
BUG=None
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/19472003
|
|
|
|
sandboxed build. Condition them properly on __native_client__.
|
|
first
|
|
|
|
|
|
on ARM fail
|
|
|
|
This applies only to %r15 sandboxed memory references. The problem
is that if the index register is negative, the sandboxing operation
will cause the index to become a large positive 32-bit value, which
combined with the displacement, will overflow and try to reference
memory outside the sandbox. This situation may legitimately occur
if the compiler happens to construct a (constant) interior pointer
to the middle of the global struct/array, and then dereferences it
with a variable offset.
After this fix, pnacl/scripts/testsuite_known_failures_pnacl.txt can
be updated to remove the "aha x86-64" known failure.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3517
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/17987002
|
|
|
|
|
|
BUG=None
R=mseaborn@chromium.org
Review URL: https://codereview.chromium.org/19284013
|
|
|
|
|
|
Conflicts:
docs/LangRef.rst
include/llvm/CodeGen/CallingConvLower.h
include/llvm/IRReader/IRReader.h
include/llvm/Target/TargetMachine.h
lib/CodeGen/CallingConvLower.cpp
lib/IRReader/IRReader.cpp
lib/IRReader/LLVMBuild.txt
lib/IRReader/Makefile
lib/LLVMBuild.txt
lib/Makefile
lib/Support/MemoryBuffer.cpp
lib/Support/Unix/PathV2.inc
lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMISelLowering.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMTargetMachine.cpp
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/MipsDelaySlotFiller.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsInstrInfo.td
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/X86/X86FastISel.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrControl.td
lib/Target/X86/X86InstrFormats.td
lib/Transforms/IPO/ExtractGV.cpp
lib/Transforms/InstCombine/InstCombineCompares.cpp
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/CodeGen/X86/fast-isel-divrem.ll
test/MC/ARM/data-in-code.ll
tools/Makefile
tools/llvm-extract/llvm-extract.cpp
tools/llvm-link/CMakeLists.txt
tools/opt/CMakeLists.txt
tools/opt/LLVMBuild.txt
tools/opt/Makefile
tools/opt/opt.cpp
|
|
Add portable support for concurrency in PNaCl's ABI:
- Promote volatile to atomic.
- Promote all memory ordering to sequential consistency.
- Rewrite all atomic operations to frozen NaCl intrinsics for pexe.
- Rewrite atomic intrinsics to LLVM instructions for translation.
This change also adds documentation to the PNaCl language reference, as
well as tests where it makes sense.
A future CL could clean up more of our code which mentions atomics,
volatiles, memory orderings.
Multiple reviewers because this is a big patch:
- eliben: LLVM-fu and ResolvePNaClIntrinsics.
- dschuff: ABI stability.
- mseaborn: ABI stability.
- sehr: Tron-duty (fight for the user's programs to work).
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
R=dschuff@chromium.org, eliben@chromium.org, sehr@google.com
TEST= (cd ./pnacl/build/llvm_x86_64; ninja check-all) && ./pnacl/test.sh test-x86-32 && ./pnacl/test.sh test-x86-64 && ./pnacl/test.sh test-arm && ./pnacl/test.sh test-x86-32-sbtc && ./pnacl/test.sh test-x86-64-sbtc && ./pnacl/test.sh test-arm-sbtc
Review URL: https://codereview.chromium.org/17777004
|
|
ARM paired GPR COPY was being lowered to two MOVr without CC. This patch puts the CC back.
I sent this patch upstream (with a test) but haven't received a review yet. This seems like a simple oversight in the code, and is holding my atomics patch so I'd like to get it into our repo.
R=dschuff@chromium.org
TEST= ./scons run_llvm_bitmanip_intrinsics_test platform=arm
BUG= no CC on MOVr
Review URL: https://codereview.chromium.org/18047006
|
|
PNaCl's LLVM sandboxing wasn't correct for ARM load/store exclusive dual. I encountered this while running our testsuite with my atomic changes: the tests which use volatile 64-bit values started failing validation.
R=dschuff@chromium.org
BUG= validation failure
TEST= ./pnacl/test.sh test-arm
Review URL: https://codereview.chromium.org/18978015
|
|
The instruction that was generated for paired register stack slot load was wrong. This was fixed by Tim Northover in LLVM 3.3 commit 179977, but his patch does much more and doesn't apply as-is to our tree. I'll therefore punt applying the full patch to when we rebase to 3.3.
I encountered the issue while working on atomics (64-bit atomics require paired registers on ARM), and saw the 3.3 fix when I tried upstreaming my fix.
BUG= non
TEST= ./pnacl/test.sh test-arm
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/18699004
|
|
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3524
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/18614013
|
|
GlobalOpt currently assumes only an external "main" is the "real main".
This is no longer the case for PNaCl, where we internalize "main". Make
the test more strict and PNaCl specific by checking that "main" is just
used once - in a call from "_start", but does not have to be external.
Note that this also addresses a possible bug in the optimization for C
code, since C does not guarantee that main is not recursive.
This CL's purpose is to address a SPEC performance regression - 10% in
183.equake. The regression appeared after our ABI change that made 'main'
internal, which disabled this particular optimization. The CL addresses
this by re-enabling the optimization and also being more C-standard
conforming.
BUG=None
Review URL: https://codereview.chromium.org/18615015
|
|
Disable an assertion. This assertion made the behaviour on x86-32
inconsistent with x86-64 and ARM.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3548
TEST=*.ll tests + PNaCl toolchain trybots
Review URL: https://codereview.chromium.org/18261008
|
|
vectorizing loops with memory accesses to non-zero address spaces. It
simply dropped the AS info. Fixes PR16306.
Merged from r184103
Author: Pekka Jaaskelainen <pekka.jaaskelainen@tut.fi>
Date: Mon Jun 17 18:49:06 2013 +0000
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_33@185869 91177308-0d34-0410-b5e6-96231b3b80d8
|
|
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
|
|
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
|
|
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=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
|
|
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
|
|
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
|
|
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
|