Age | Commit message (Collapse) | Author |
|
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
|
|
Make the bitcode reader stricter, so that it disallows pointer
arguments in indirect function calls, which are disallowed by the
PNaCl ABI checker. Pointer arguments in function calls are only
allowed in intrinsic calls, and calls to intrinsics must always be
direct calls, not indirect calls.
This involves removing two tests that specifically test for pointer
args.
This is in preparation for tweaking how indirect calls are
represented, so that they store the call's return type rather than the
function type.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3544
TEST=*.ll tests
Review URL: https://codereview.chromium.org/23660005
|
|
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
|
|
Localmods came from: https://codereview.chromium.org/10825082/, and earlier.
(1) The original change was so that byval parameters always
go on the stack. That part was added because the original
ARM code was buggy, and did not actually make a copy of the
value, modifying the caller's struct (ouch!).
(2) Then came a localmod to make all arguments following a
byval go on the stack and to make the var-args code aware of
that. This is so that arguments stay in the correct order
for var-args to pick up.
For (1) there has been some work upstream to make it work
better. In any case, clang with --target=armv7a-...-gnueabi
only used byval in some limited cases -- when the size of
the struct is > 64 bytes where the backend will know
that part of it could be in regs, and the rest can be
memcpy'ed to the stack.
For le32, clang will still generate byval without
satisfying the same ARM condition (only for structs
bigger than 64 bytes), so it could be *very bad* if
we didn't have the ABI simpification passes rewrite
the byval and try to let the ARM backend do things
with byval...
TEST=the GCC torture tests: va-arg-4.c, and 20030914-2.c
and the example in issue 2746 still pass.
BUG=none, cleanup
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/23691009
|
|
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
|
|
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=3627
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/23060004
|
|
16-bit atomics aren't handled properly by the current validator, this patch changes the translator so that on x86-32 it emulates 16-bit atomics with 32-bit atomics in a compare-exchange loop.
TEST= ./scons run_synchronization_sync_test bitcode=1 platform=x86-32
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3579
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2981
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/22760002
|
|
This is a follow-up to:
https://codereview.chromium.org/22240002/
And requires the Clang changes from:
https://codereview.chromium.org/22294002/
This new intrinsic represents ``asm("":::"~{memory}")`` as well as ``__sync_synchronize()``, and in IR it corresponds to a sequentially-consistent fence surrounded by ``call void asm sideeffect "", "~{memory}"()``.
R=jvoung@chromium.org
TEST= ninja check-all
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
Review URL: https://codereview.chromium.org/22474008
|
|
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
|
|
Fixes change in CL https://codereview.chromium.org/21614002 that was
overlooked.
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/21908004
|
|
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
|
|
This is part of a bigger CL to fix C++11 in PNaCl, to commit in the following order:
- https://codereview.chromium.org/20552002
- https://codereview.chromium.org/20554002
- https://codereview.chromium.org/20560002
- https://codereview.chromium.org/20561002
This should be the last PNaCl ABI change for C11/C+11 atomic support.
Note that Clang already has a builtin for lock-free, but it's partly resolved by Clang's ExprConstant.cpp and CGBuiltin.cpp, whereas what we want is a call that becomes a constant at translation-time. I made the translation part fairly general so it's easy to support architectures where ``true`` isn't always the right answer.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3475
TEST= ./scons run_synchronization_cpp11_test --verbose bitcode=1 platform=x86-64
TEST= ninja check-all
R=dschuff@chromium.org
Review URL: https://codereview.chromium.org/20554002
|
|
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
|
|
This is often used as a compiler barrier and should "just work" in user code.
BUG= https://code.google.com/p/nativeclient/issues/detail?id=2345
R=eliben@chromium.org
TEST= (cd ./pnacl/build/llvm_x86_64 && ninja check-all)
Review URL: https://codereview.chromium.org/21178002
|
|
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3588
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19606003
|
|
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
|
|
BUG= test the fix that was already cherrypicked
TEST= self
R=eliben@chromium.org
Review URL: https://codereview.chromium.org/19704008
|
|
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
|
|
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
|
|
Suggested in review: https://codereview.chromium.org/19705002/
BUG=None
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/19774012
|
|
|
|
|
|
The issues these tests exercise came up in the recent merge of LLVM 3.3;
Since it's considerably more difficult to debug problems in scons tests or
sbtc tests, it makes sense to increase the coverate of LLVM regression tests
as much as possible. These tests help resolve merging issues relatively quickly
and should provide a first-line defense against problem arising in the NaCl
specific LOCALMODs we have within LLVM.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3578
R=jfb@chromium.org
Review URL: https://codereview.chromium.org/19705002
|
|
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
|
|
|
|
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
|
|
By default, using the path inherited from llc, the verifier is run twice.
We only need it to run once right after reading the bitcode in and before
the ABI verifier runs.
BUG=https://code.google.com/p/nativeclient/issues/detail?id=3553
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/18920004
|
|
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
|
|
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
|
|
(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
|
|
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
|