1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
Commit Graph

6327 Commits

Author SHA1 Message Date
Mike Aizatsky
5c882cb2b9 [libfuzzer][doc] documenting running libfuzzer tests.
Differential Revision: http://reviews.llvm.org/D20594

llvm-svn: 270626
2016-05-24 22:25:46 +00:00
Lang Hames
e4d5aef619 [Kaleidoscope] Add an initial "Building an ORC JIT" tutorial chapter.
This is a work in progress - the chapter text is incomplete, though
the example code compiles and runs.

Feedback and patches are, as usual, most welcome.

llvm-svn: 270487
2016-05-23 20:34:19 +00:00
Amaury Sechet
10d07e35d2 Extract renaming from D19181
Summary: This needs to get in before anything is released concerning attribute. If the old name gets in the wild, then we are stuck with it forever. Putting it in its own diff should getting that part at least in fast.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael, jyknight

Subscribers: llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D20417

llvm-svn: 270452
2016-05-23 16:38:25 +00:00
Peter Collingbourne
7b48110e9a docs: Update and clean up BitCodeFormat.rst.
llvm-svn: 269857
2016-05-17 22:30:58 +00:00
Rafael Espindola
668416cf2a Fail early on unknown appending linkage variables.
In practice only a few well known appending linkage variables work.

Currently if codegen sees an unknown appending linkage variable it will
just print it as a regular global. That is wrong as the symbol in the
produced object file has different semantics as the one provided by the
appending linkage.

This just errors early instead of producing a broken .o.

llvm-svn: 269706
2016-05-16 21:14:24 +00:00
Renato Golin
a472d7e2ff [Docs] Add some requirements to the Testing Guide
Patch by Diana Picus.

llvm-svn: 269566
2016-05-14 14:27:40 +00:00
John Regehr
c1b0c5a7b4 [Docs] clarify semantics of x.with.overflow intrinsics
Differential Revision: http://reviews.llvm.org/D20151

llvm-svn: 269346
2016-05-12 20:55:09 +00:00
Sanjoy Das
ee178ad6c3 All llvm.deoptimize declarations must use the same calling convention
This new verifier rule lets us unambigously pick a calling convention
when creating a new declaration for
`@llvm.experimental.deoptimize.<ty>`.  It is also congruent with our
lowering strategy -- since all calls to `@llvm.experimental.deoptimize`
are lowered to calls to `__llvm_deoptimize`, it is reasonable to enforce
a unique calling convention.

Some of the tests that were breaking this verifier rule have had to be
split up into different .ll files.

The inliner was violating this rule as well, and has been fixed to avoid
producing invalid IR.

llvm-svn: 269261
2016-05-12 01:17:38 +00:00
Chris Lattner
31916392c5 Most common problem is that I get md5 hashes, not crypt hashes.
llvm-svn: 269157
2016-05-11 03:47:36 +00:00
Kostya Serebryany
ee5ec94de0 [libFuzzer] mention the AFL driver in the docs
llvm-svn: 269143
2016-05-10 23:52:47 +00:00
Rafael Espindola
3560edede3 Make "@name =" mandatory for globals in .ll files.
An oddity of the .ll syntax is that the "@var = " in

@var = global i32 42

is optional. Writing just

global i32 42

is equivalent to

@0 = global i32 42

This means that there is a pretty big First set at the top level. The
current implementation maintains it manually. I was trying to refactor
it, but then started wondering why keep it a all. I personally find the
above syntax confusing. It looks like something is missing.

This patch removes the feature and simplifies the parser.

llvm-svn: 269096
2016-05-10 18:22:45 +00:00
Renato Golin
2d3223210a [docs] Fix unexpected indentation in HowToCrossCompileLLVM.rst
Seems like my sphynx version is different than the one in the bot, as it
accepted everything locally. I think this is the right fix...

llvm-svn: 269062
2016-05-10 14:02:46 +00:00
Renato Golin
61778268f4 [docs] Change CrossCompilation guidde to reflect changes in Clang/GCC
HowToCrossCompile was outdated and generating too much traffic on the mailing
list with similar queries. This change helps offset most of the problems that
were reported recently including:

 * Removing the -ccc-gcc-name, adding --sysroot
 * Making references to Debian's multiarch for target libraries
 * Expanding -DCMAKE_CXX_FLAGS for both GCC and Clang
 * Some formatting and clarifications in the text

llvm-svn: 269054
2016-05-10 12:54:12 +00:00
Kostya Serebryany
a225a8d958 [libFuzzer] add a test for libFuzzer+ubsan, extend the docs on using libFuzzer+ubsan
llvm-svn: 268968
2016-05-09 21:02:36 +00:00
Kostya Serebryany
5d462447f2 [libFuzzer] reshuffle docs more
llvm-svn: 268961
2016-05-09 19:32:10 +00:00
Kostya Serebryany
89c9635b0a [libFuzzer] reshuffle docs
llvm-svn: 268959
2016-05-09 19:29:53 +00:00
Kostya Serebryany
0611ca6f4a [libFuzzer] better document the -merge=1 flag, part 2
llvm-svn: 268958
2016-05-09 19:23:28 +00:00
Kostya Serebryany
bd6b8a3638 [libFuzzer] better document the -merge=1 flag
llvm-svn: 268957
2016-05-09 19:11:36 +00:00
Kostya Serebryany
8f61eefd2f [libFuzzer] modify the docs for startup/init
llvm-svn: 268824
2016-05-06 23:51:28 +00:00
Kostya Serebryany
9895cf9ee1 [libFuzzer] tweak the documentation about rss_limit
llvm-svn: 268822
2016-05-06 23:41:11 +00:00
Kostya Serebryany
6a10031791 [libFuzzer] enhance -rss_limit_mb and enable by default. Now it will print the OOM reproducer.
llvm-svn: 268821
2016-05-06 23:38:07 +00:00
Kostya Serebryany
b29cae8463 [libFuzzer] more trophies
llvm-svn: 268788
2016-05-06 20:14:48 +00:00
Justin Bogner
9448d374ee SDAG: Rename Select->SelectImpl and repurpose Select as returning void
This is a step towards removing the rampant undefined behaviour in
SelectionDAG, which is a part of llvm.org/PR26808.

We rename SelectionDAGISel::Select to SelectImpl and update targets to
match, and then change Select to return void and consolidate the
sketchy behaviour we're trying to get away from there.

Next, we'll update backends to implement `void Select(...)` instead of
SelectImpl and eventually drop the base Select implementation.

llvm-svn: 268693
2016-05-05 23:19:08 +00:00
Kostya Serebryany
ff92cc291d [libFuzzer] better docs for coverage
llvm-svn: 268656
2016-05-05 18:07:09 +00:00
James Y Knight
49bc30f7bb Remove bit-rotten CppBackend.
This backend was supposed to generate C++ code which will re-construct
the LLVM IR passed as input. This seems to me to have very marginal
usefulness in the first place.

However, the code has never been updated to use IRBuilder, which makes
its current value negative -- people who look at the output may be
steered to use the *wrong* C++ APIs to construct IR.

Furthermore, it's generated code that doesn't compile since at least
2013.

Differential Revision: http://reviews.llvm.org/D19942

llvm-svn: 268631
2016-05-05 14:35:40 +00:00
Jingyue Wu
8fb0389f2b [NVPTX:doc] Update code examples to conform to the latest IR.
llvm-svn: 268522
2016-05-04 17:34:57 +00:00
David L Kreitzer
ed75c93233 Add an address space for the X86 SS segment.
Patch by Michael LeMay (michael.lemay@intel.com)

Differential Revision: http://reviews.llvm.org/D17093

llvm-svn: 268431
2016-05-03 20:16:08 +00:00
Simon Pilgrim
4ed5a81a43 Document the LLVM_ENABLE_EXPENSIVE_CHECKS cmake option introduced in r268050
llvm-svn: 268197
2016-05-01 15:27:47 +00:00
Sanjoy Das
0d28098245 [LowerGuardIntrinsics] Keep track of !make.implicit metadata
If a guard call being lowered by LowerGuardIntrinsics has the
`!make.implicit` metadata attached, then reattach the metadata to the
branch in the resulting expanded form of the intrinsic.  This allows us
to implement null checks as guards and still get the benefit of implicit
null checks.

llvm-svn: 268148
2016-04-30 00:55:59 +00:00
Chris Bieneman
9c4f3cfc37 [Docs] Refer to the CMakePrimer from CMake doc
The "Building LLVM with CMake" document should have a reference to the CMakePrimer.

llvm-svn: 268109
2016-04-29 21:23:24 +00:00
Chris Bieneman
6fb260949c [Docs] Add CMake Primer document
This document is intended to provide a basic overview of the CMake scripting language for LLVM developers. It was unorthodoxly reviewed for accuracy and content on the CMake developer list:

http://public.kitware.com/pipermail/cmake-developers/2016-April/028300.html

llvm-svn: 268096
2016-04-29 20:34:54 +00:00
Kostya Serebryany
d357a30eb0 [libFuzzer] fix docs
llvm-svn: 268092
2016-04-29 19:28:24 +00:00
Kostya Serebryany
6e5d1a22c3 [libFuzzer] enable detect_leaks=1, add proper docs
llvm-svn: 268088
2016-04-29 18:49:55 +00:00
Sanjoy Das
e12c5af2ac Remove stale documentation on -no-aa
The pass itself was removed in rL247167.

llvm-svn: 267978
2016-04-29 03:01:49 +00:00
Kostya Serebryany
f69f881341 [libFuzzer] Improve documentation
Reviewers: kcc

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19585

llvm-svn: 267892
2016-04-28 15:19:05 +00:00
Adam Nemet
083815b3cc Fixed sphinx warning from r267672
llvm-svn: 267675
2016-04-27 05:59:51 +00:00
Adam Nemet
ededcfa020 [LoopDist] Add llvm.loop.distribute.enable loop metadata
Summary:
D19403 adds a new pragma for loop distribution.  This change adds
support for the corresponding metadata that the pragma is translated to
by the FE.

As part of this I had to rethink the flag -enable-loop-distribute.  My
goal was to be backward compatible with the existing behavior:

  A1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute is specified

  A2. pass is on when invoked directly from opt (e.g. for unit-testing)

The new pragma/metadata overrides these defaults so the new behavior is:

  B1. A1 + enable distribution for individual loop with the pragma/metadata

  B2. A2 + disable distribution for individual loop with the pragma/metadata

The default value whether the pass is on or off comes from the initiator
of the pass.  From the PassManagerBuilder the default is off, from opt
it's on.

I moved -enable-loop-distribute under the pass.  If the flag is
specified it overrides the default from above.

Then the pragma/metadata can further modifies this per loop.

As a side-effect, we can now also use -enable-loop-distribute=0 from opt
to emulate the default from the optimization pipeline.  So to be precise
this is the new behavior:

  C1. pass is off by default from the optimization pipeline
  unless -enable-loop-distribute or the pragma/metadata enables it

  C2. pass is on when invoked directly from opt
  unless -enable-loop-distribute=0 or the pragma/metadata disables it

Reviewers: hfinkel

Subscribers: joker.eph, mzolotukhin, llvm-commits

Differential Revision: http://reviews.llvm.org/D19431

llvm-svn: 267672
2016-04-27 05:28:18 +00:00
Adam Nemet
9d448b66bc [Docs] Try to clarify the concept of domains for noalias scope
Summary:
This tries to anchor down the concept of domains a bit better.  I had
trouble initially relating this to anything.  Also talking to David
Majnemer on IRC suggested that I wasn't the only one.

Reviewers: hfinkel

Subscribers: llvm-commits, majnemer

Differential Revision: http://reviews.llvm.org/D18799

llvm-svn: 267647
2016-04-27 00:52:48 +00:00
Chuang-Yu Cheng
da7d0bf651 [ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail-call issue
print-stack-trace.cc test failure of compiler-rt has been fixed by
r266869 (http://reviews.llvm.org/D19148), so reenable sibling call
optimization on ppc64

Reviewers: nemanjai kbarton
llvm-svn: 267527
2016-04-26 07:38:24 +00:00
Hal Finkel
7956f36dac [LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops
I really thought we were doing this already, but we were not. Given this input:

void Test(int *res, int *c, int *d, int *p) {
  for (int i = 0; i < 16; i++)
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
}

we did not vectorize the loop. Even with "assume_safety" the check that we
don't if-convert conditionally-executed loads (to protect against
data-dependent deferenceability) was not elided.

One subtlety: As implemented, it will still prefer to use a masked-load
instrinsic (given target support) over the speculated load. The choice here
seems architecture specific; the best option depends on how expensive the
masked load is compared to a regular load. Ideally, using the masked load still
reduces unnecessary memory traffic, and so should be preferred. If we'd rather
do it the other way, flipping the order of the checks is easy.

The LangRef is updated to make explicit that llvm.mem.parallel_loop_access also
implies that if conversion is okay.

Differential Revision: http://reviews.llvm.org/D19512

llvm-svn: 267514
2016-04-26 02:00:36 +00:00
Duncan P. N. Exon Smith
94512f24de DebugInfo: Remove MDString-based type references
Eliminate DITypeIdentifierMap and make DITypeRef a thin wrapper around
DIType*.  It is no longer legal to refer to a DICompositeType by its
'identifier:', and DIBuilder no longer retains all types with an
'identifier:' automatically.

Aside from the bitcode upgrade, this is mainly removing logic to resolve
an MDString-based reference to an actualy DIType.  The commits leading
up to this have made the implicit type map in DICompileUnit's
'retainedTypes:' field superfluous.

This does not remove DITypeRef, DIScopeRef, DINodeRef, and
DITypeRefArray, or stop using them in DI-related metadata.  Although as
of this commit they aren't serving a useful purpose, there are patchces
under review to reuse them for CodeView support.

The tests in LLVM were updated with deref-typerefs.sh, which is attached
to the thread "[RFC] Lazy-loading of debug info metadata":

  http://lists.llvm.org/pipermail/llvm-dev/2016-April/098318.html

llvm-svn: 267296
2016-04-23 21:08:00 +00:00
Sanjoy Das
5fea8e874e Add some release notes about the fix for PR26774
As suggested by Chandler on the review thread for D18634.

llvm-svn: 267239
2016-04-22 22:45:23 +00:00
Peter Collingbourne
d04766ba20 Introduce llvm.load.relative intrinsic.
This intrinsic takes two arguments, ``%ptr`` and ``%offset``. It loads
a 32-bit value from the address ``%ptr + %offset``, adds ``%ptr`` to that
value and returns it. The constant folder specifically recognizes the form of
this intrinsic and the constant initializers it may load from; if a loaded
constant initializer is known to have the form ``i32 trunc(x - %ptr)``,
the intrinsic call is folded to ``x``.

LLVM provides that the calculation of such a constant initializer will
not overflow at link time under the medium code model if ``x`` is an
``unnamed_addr`` function. However, it does not provide this guarantee for
a constant initializer folded into a function body. This intrinsic can be
used to avoid the possibility of overflows when loading from such a constant.

Differential Revision: http://reviews.llvm.org/D18367

llvm-svn: 267223
2016-04-22 21:18:02 +00:00
Michael Kuperstein
8bf993fc77 Point link to CODE_OWNERS.txt to klaus instead of viewvc.
llvm-svn: 267176
2016-04-22 17:41:12 +00:00
Teresa Johnson
39da0c928b Document source_filename in LangRef.
Summary: Add documentation for new LLVM IR source_filename identifier.

Reviewers: joker.eph, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D18857

llvm-svn: 267150
2016-04-22 13:09:17 +00:00
Amaury Sechet
8c1203a67d Add LLVMGetAttrKindID in the C API in order to facilitate migration away from LLVMAttribute
Summary:
LLVMAttribute has outlived its utility and is becoming a problem for C API users that what to use all the LLVM attributes. In order to help moving away from LLVMAttribute in a smooth manner, this diff introduce LLVMGetAttrKindIDInContext, which can be used instead of the enum values.

See D18749 for reference.

Reviewers: Wallbraker, whitequark, joker.eph, echristo, rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D19081

llvm-svn: 266842
2016-04-20 01:02:12 +00:00
Kostya Serebryany
f4b1c52a7a [libFuzzer] more trophies
llvm-svn: 266830
2016-04-19 22:37:44 +00:00
Marcin Koscielnicki
0919e582e6 [AArch64] [ARM] Make a target-independent llvm.thread.pointer intrinsic.
Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that
just return the thread pointer.  I have a pending patch that does the same
for SystemZ (D19054), and there are many more targets that could benefit
from one.

This patch merges the ARM and AArch64 intrinsics into a single target
independent one that will also be used by subsequent targets.

Differential Revision: http://reviews.llvm.org/D19098

llvm-svn: 266818
2016-04-19 20:51:05 +00:00
Tim Shen
3a75cd4bf9 [SSP, 2/2] Create llvm.stackguard() intrinsic and lower it to LOAD_STACK_GUARD
With this change, ideally IR pass can always generate llvm.stackguard
call to get the stack guard; but for now there are still IR form stack
guard customizations around (see getIRStackGuard()). Future SSP
customization should go through LOAD_STACK_GUARD.

There is a behavior change: stack guard values are not CSEed anymore,
since we should never reuse the value in case that it has been spilled (and
corrupted). See ssp-guard-spill.ll. This also cause the change of stack
size and codegen in X86 and AArch64 test cases.

Ideally we'd like to know if the guard created in llvm.stackprotector() gets
spilled or not. If the value is spilled, discard the value and reload
stack guard; otherwise reuse the value. This can be done by teaching
register allocator to know how to rematerialize LOAD_STACK_GUARD and
force a rematerialization (which seems hard), or check for spilling in
expandPostRAPseudo. It only makes sense when the stack guard is a global
variable, which requires more instructions to load. Anyway, this seems to go out
of the scope of the current patch.

llvm-svn: 266806
2016-04-19 19:40:37 +00:00
Sanjoy Das
91fd65c3a6 Introduce a "patchable-function" function attribute
Summary:
The `"patchable-function"` attribute can be used by an LLVM client to
influence LLVM's code generation in ways that makes the generated code
easily patchable at runtime (for instance, to redirect control).
Right now only one patchability scheme is supported,
`"prologue-short-redirect"`, but this can be expanded in the future.

Reviewers: joker.eph, rnk, echristo, dberris

Subscribers: joker.eph, echristo, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D19046

llvm-svn: 266715
2016-04-19 05:24:47 +00:00
Kostya Serebryany
b5ecf4df2a [libFuzzer] add fresh openssl trophies
llvm-svn: 266649
2016-04-18 18:41:25 +00:00
Duncan P. N. Exon Smith
0c4233db2f IR: Use an explicit map for debug info type uniquing
Rather than relying on the structural equivalence of DICompositeType to
merge type definitions, use an explicit map on the LLVMContext that
LLParser and BitcodeReader consult when constructing new nodes.
Each non-forward-declaration DICompositeType with a non-empty
'identifier:' field is stored/loaded from the type map, and the first
definiton will "win".

This map is opt-in: clients that expect ODR types from different modules
to be merged must call LLVMContext::ensureDITypeMap.

  - Clients that just happen to load more than one Module in the same
    LLVMContext won't magically merge types.

  - Clients (like LTO) that want to continue to merge types based on ODR
    identifiers should opt-in immediately.

I have updated LTOCodeGenerator.cpp, the two "linking" spots in
gold-plugin.cpp, and llvm-link (unless -disable-debug-info-type-map) to
set this.

With this in place, it will be straightforward to remove the DITypeRef
concept (i.e., referencing types by their 'identifier:' string rather
than pointing at them directly).

llvm-svn: 266549
2016-04-17 03:58:21 +00:00
Duncan P. N. Exon Smith
a1404a67fa IR: Use ODR to unique DICompositeType members
Merge members that are describing the same member of the same ODR type,
even if other bits differ.  If the file or line differ, we don't care;
if anything else differs, it's an ODR violation (and we still don't
really care).

For DISubprogram declarations, this looks at the LinkageName and Scope.
For DW_TAG_member instances of DIDerivedType, this looks at the Name and
Scope.  In both cases, we know that the Scope follows ODR rules if it
has a non-empty identifier.

llvm-svn: 266548
2016-04-17 02:30:20 +00:00
Duncan P. N. Exon Smith
0e96399288 LangRef: Removed some outdated text about DIDerivedType
This text is also incorrect (much like r266540).  It looks like I missed
updating some of what I moved from SourceLevelDebugging.rst in r232566.

llvm-svn: 266544
2016-04-17 00:45:00 +00:00
Duncan P. N. Exon Smith
dcf69939b8 LangRef: Fix some bugs in debug info descriptions
Fix descriptions of DICompositeType and DIDerivedType.

llvm-svn: 266540
2016-04-16 22:46:47 +00:00
Kostya Serebryany
5c9ea3ceb9 [libFuzzer] menion the git mirror in the docs
llvm-svn: 266476
2016-04-15 21:10:27 +00:00
Mehdi Amini
ea195a382e Remove every uses of getGlobalContext() in LLVM (but the C API)
At the same time, fixes InstructionsTest::CastInst unittest: yes
you can leave the IR in an invalid state and exit when you don't
destroy the context (like the global one), no longer now.

This is the first part of http://reviews.llvm.org/D19094

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 266379
2016-04-14 21:59:01 +00:00
Adam Nemet
aa40b369a6 Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This reverts commit r266086.

It breaks the LTO build of gcc in SPEC2000.

llvm-svn: 266282
2016-04-14 08:47:17 +00:00
James Y Knight
b06645b66f Update psabi link for x86-64. Add link to linux gabi supplement.
llvm-svn: 266137
2016-04-12 21:54:57 +00:00
James Y Knight
a55b68a75e Add __atomic_* lowering to AtomicExpandPass.
(Recommit of r266002, with r266011, r266016, and not accidentally
including an extra unused/uninitialized element in LibcallRoutineNames)

AtomicExpandPass can now lower atomic load, atomic store, atomicrmw, and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.

This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.

Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.

This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.

It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.

At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.

Differential Revision: http://reviews.llvm.org/D18200

llvm-svn: 266115
2016-04-12 20:18:48 +00:00
Artur Pilipenko
d9a8d9a1af Support arbitrary addrspace pointers in masked load/store intrinsics
This is a resubmittion of 263158 change.

This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace.

The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics.

Reviewed By: reames

Differential Revision: http://reviews.llvm.org/D17270

llvm-svn: 266086
2016-04-12 15:58:04 +00:00
Matt Arsenault
73354d0f62 LangRef: Update example syntax for atomic load instruction
llvm-svn: 266077
2016-04-12 14:41:03 +00:00
Rafael Espindola
b04bc032f0 This reverts commit r266002, r266011 and r266016.
They broke the msan bot.

Original message:

Add __atomic_* lowering to AtomicExpandPass.

AtomicExpandPass can now lower atomic load, atomic store, atomicrmw,and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.

This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.

Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.

This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.

It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.

At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.

Differential Revision: http://reviews.llvm.org/D18200

llvm-svn: 266062
2016-04-12 12:30:25 +00:00
George Burgess IV
4e2d8dca99 Add the allocsize attribute to LLVM.
`allocsize` is a function attribute that allows users to request that
LLVM treat arbitrary functions as allocation functions.

This patch makes LLVM accept the `allocsize` attribute, and makes
`@llvm.objectsize` recognize said attribute.

The review for this was split into two patches for ease of reviewing:
D18974 and D14933. As promised on the revisions, I'm landing both
patches as a single commit.

Differential Revision: http://reviews.llvm.org/D14933

llvm-svn: 266032
2016-04-12 01:05:35 +00:00
James Y Knight
003ee915ba Add __atomic_* lowering to AtomicExpandPass.
AtomicExpandPass can now lower atomic load, atomic store, atomicrmw, and
cmpxchg instructions to __atomic_* library calls, when the target
doesn't support atomics of a given size.

This is the first step towards moving all atomic lowering from clang
into llvm. When all is done, the behavior of __sync_* builtins,
__atomic_* builtins, and C11 atomics will be unified.

Previously LLVM would pass everything through to the ISelLowering
code. There, unsupported atomic instructions would turn into __sync_*
library calls. Because of that behavior, Clang currently avoids emitting
llvm IR atomic instructions when this would happen, and emits __atomic_*
library functions itself, in the frontend.

This change makes LLVM able to emit __atomic_* libcalls, and thus will
eventually allow clang to depend on LLVM to do the right thing.

It is advantageous to do the new lowering to atomic libcalls in
AtomicExpandPass, before ISel time, because it's important that all
atomic operations for a given size either lower to __atomic_*
libcalls (which may use locks), or native instructions which won't. No
mixing and matching.

At the moment, this code is enabled only for SPARC, as a
demonstration. The next commit will expand support to all of the other
targets.

Differential Revision: http://reviews.llvm.org/D18200

llvm-svn: 266002
2016-04-11 22:22:33 +00:00
Tim Shen
8cac1d5c28 [SSP] Remove llvm.stackprotectorcheck.
This is a cleanup patch for SSP support in LLVM. There is no functional change.
llvm.stackprotectorcheck is not needed, because SelectionDAG isn't
actually lowering it in SelectBasicBlock; rather, it adds check code in
FinishBasicBlock, ignoring the position where the intrinsic is inserted
(See FindSplitPointForStackProtector()).

llvm-svn: 265851
2016-04-08 21:26:31 +00:00
Ehsan Amiri
12e9a7d1ed [PPC] Added a note to release notes
A draft line added to release notes for PPC, to keep a record of changes.
This is just a draft and will be rewritten towards the end of release.

llvm-svn: 265694
2016-04-07 16:47:35 +00:00
Dmitry Polukhin
9d54726038 [GCC] Attribute ifunc support in llvm
This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. Patch
for Clang http://reviews.llvm.org/D15524

Differential Revision: http://reviews.llvm.org/D15525

llvm-svn: 265667
2016-04-07 12:32:19 +00:00
JF Bastien
f4f5b32f44 NFC: make AtomicOrdering an enum class
Summary:
In the context of http://wg21.link/lwg2445 C++ uses the concept of
'stronger' ordering but doesn't define it properly. This should be fixed
in C++17 barring a small question that's still open.

The code currently plays fast and loose with the AtomicOrdering
enum. Using an enum class is one step towards tightening things. I later
also want to tighten related enums, such as clang's
AtomicOrderingKind (which should be shared with LLVM as a 'C++ ABI'
enum).

This change touches a few lines of code which can be improved later, I'd
like to keep it as NFC for now as it's already quite complex. I have
related changes for clang.

As a follow-up I'll add:
  bool operator<(AtomicOrdering, AtomicOrdering) = delete;
  bool operator>(AtomicOrdering, AtomicOrdering) = delete;
  bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
  bool operator>=(AtomicOrdering, AtomicOrdering) = delete;
This is separate so that clang and LLVM changes don't need to be in sync.

Reviewers: jyknight, reames

Subscribers: jyknight, llvm-commits

Differential Revision: http://reviews.llvm.org/D18775

llvm-svn: 265602
2016-04-06 21:19:33 +00:00
Tom Stellard
f352d0cd70 AMDGPU: Document address space mapping
Summary:
Address space mapping is described in lib/Target/AMDGPU/AMDGPU.h in
Doxygen comments. This patch adds the description to user guide for
AMDGPU back-end.

Patch By: Vedran Miletić

Reviewers: tstellarAMD, arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17046

llvm-svn: 265500
2016-04-06 01:29:19 +00:00
Manman Ren
6e8ec540e6 Swift Calling Convention: swiftcc for ARM.
Differential Revision: http://reviews.llvm.org/D18769

llvm-svn: 265482
2016-04-05 22:44:44 +00:00
Manman Ren
d8f96bea63 Swift Calling Convention: add swiftcc.
Differential Revision: http://reviews.llvm.org/D17863

llvm-svn: 265480
2016-04-05 22:41:47 +00:00
JF Bastien
f164daa424 Docs: dampen story time for atomics
Story time was nice a few years ago, but by now it's nice to state how things are, rather than explain the diff from ye olden atomic history. These were dark times.

llvm-svn: 265369
2016-04-05 00:31:25 +00:00
Paul Robinson
a4abbe046e Document standard substitutions defined by lit.
Patch by Guilherme Bufolo!

Differential Revision: http://reviews.llvm.org/D18752

llvm-svn: 265314
2016-04-04 17:14:45 +00:00
Manman Ren
ad40523f14 Swift Calling Convention: add swifterror attribute.
A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.

This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.

Differential Revision: http://reviews.llvm.org/D18092

llvm-svn: 265189
2016-04-01 21:41:15 +00:00
Adrian Prantl
1653aa9f14 testcase gardening: update the emissionKind enum to the new syntax. (NFC)
llvm-svn: 265081
2016-04-01 00:16:49 +00:00
Hans Wennborg
07d10a6e30 Change eliminateCallFramePseudoInstr() to return an iterator
This will become necessary in a subsequent change to make this method
merge adjacent stack adjustments, i.e. it might erase the previous
and/or next instruction.

It also greatly simplifies the calls to this function from Prolog-
EpilogInserter. Previously, that had a bunch of logic to resume iteration
after the call; now it just continues with the returned iterator.

Note that this changes the behaviour of PEI a little. Previously,
it attempted to re-visit the new instruction created by
eliminateCallFramePseudoInstr(). That code was added in r36625,
but I can't see any reason for it: the new instructions will obviously
not be pseudo instructions, they will not have FrameIndex operands,
and we have already accounted for the stack adjustment.

Differential Revision: http://reviews.llvm.org/D18627

llvm-svn: 265036
2016-03-31 18:33:38 +00:00
Sanjoy Das
f200766275 Introduce a @llvm.experimental.guard intrinsic
Summary:
As discussed on llvm-dev[1].

This change adds the basic boilerplate code around having this intrinsic
in LLVM:

 - Changes in Intrinsics.td, and the IR Verifier
 - A lowering pass to lower @llvm.experimental.guard to normal
   control flow
 - Inliner support

[1]: http://lists.llvm.org/pipermail/llvm-dev/2016-February/095523.html

Reviewers: reames, atrick, chandlerc, rnk, JosephTremoulet, echristo

Subscribers: mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18527

llvm-svn: 264976
2016-03-31 00:18:46 +00:00
Sanjay Patel
51beb28734 fix typos
llvm-svn: 264933
2016-03-30 21:38:20 +00:00
Justin Lebar
d23b7bb4ec [NVPTX] Make NVVMReflect a function pass.
Summary:
Currently it's a module pass.  Make it a function pass so that we can
move it to PassManagerBuilder's EP_EarlyAsPossible extension point,
which only accepts function passes.

Reviewers: rnk

Subscribers: tra, llvm-commits, jholewinski

Differential Revision: http://reviews.llvm.org/D18615

llvm-svn: 264919
2016-03-30 20:40:11 +00:00
Jingyue Wu
b932f8f175 [docs] Add gpucc publication and tutorial.
llvm-svn: 264839
2016-03-30 05:05:40 +00:00
Kostya Serebryany
a6e8668e11 [libFuzzer] more trophies
llvm-svn: 264804
2016-03-29 23:13:25 +00:00
Kostya Serebryany
c35be8422b [libFuzzer] more docs
llvm-svn: 264803
2016-03-29 23:07:36 +00:00
Aaron Ballman
00d9bf7a62 Clarifying some of the requirements for building with Visual Studio on Windows. Namely, we require the latest Update to be installed (for sanity purposes), and we require CMake 2.8.12.2 for building LLVM with Visual Studio.
llvm-svn: 264779
2016-03-29 20:23:55 +00:00
Manman Ren
620c905661 Swift Calling Convention: add swiftself attribute.
Differential Revision: http://reviews.llvm.org/D17866

llvm-svn: 264754
2016-03-29 17:37:21 +00:00
Elena Demikhovsky
a56b1c3d68 Added 2 notes
1) Skylake and KNL support for X86
2) masked intrinsics load/store/gather/scatter

Differential Revision: http://reviews.llvm.org/D18353

llvm-svn: 264703
2016-03-29 06:55:56 +00:00
Vedant Kumar
4a4096c714 [docs] Corrections w.r.t V2 of the coverage mapping format
llvm-svn: 264679
2016-03-28 22:16:01 +00:00
Nico Weber
94d3e7c0d1 docs: Fix footnote after r260042.
r260042 removed a footnote referring to autoconf, but it left
around one item still referring to that footnote (libtool), and
it didn't renumber the later footnote reference.

llvm-svn: 264663
2016-03-28 21:24:46 +00:00
Nico Weber
4955de5221 docs: Try to remove weird linebreak from generated html.
llvm-svn: 264654
2016-03-28 21:00:21 +00:00
Nico Weber
44b4c4793d docs: Update Ninja link, also fix link syntax.
llvm-svn: 264648
2016-03-28 20:32:38 +00:00
Lang Hames
8945842662 [Kaleidoscope] Rename Error -> LogError in Chapters 2-5.
This keeps the naming consistent with Chapters 6-8, where Error was renamed to
LogError in r264426 to avoid clashes with the new Error class in libSupport.

llvm-svn: 264427
2016-03-25 17:41:26 +00:00
Lang Hames
26792dd2ba [Kaleidoscope] Fix 'Error' name clashes.
llvm-svn: 264426
2016-03-25 17:33:32 +00:00
Reid Kleckner
57ae7f9db2 Try to fix ODR violation of ErrorInfo::ID
This implements my suggestion to Lang.

llvm-svn: 264360
2016-03-24 23:49:34 +00:00
Sanjoy Das
b1899b2cab Add lowering support for llvm.experimental.deoptimize
Summary:
Only adds support for "naked" calls to llvm.experimental.deoptimize.
Support for round-tripping through RewriteStatepointsForGC will come
as a separate patch (should be simpler than this one).

Reviewers: reames

Subscribers: sanjoy, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D18429

llvm-svn: 264329
2016-03-24 20:23:29 +00:00
Chris Bieneman
c6ea540077 [Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN
This is based on feedback on llvm-commits from Sean Silvas.

llvm-svn: 264318
2016-03-24 18:46:43 +00:00
Lang Hames
18415e1c16 [docs] Clarify Error example in Programmer's Manual.
llvm-svn: 264314
2016-03-24 18:05:21 +00:00
Justin Bogner
a8d4a2dea1 docs: Fix a missing language in a code-block
This should fix the docs build.
Spotted by spstarr, thanks!

llvm-svn: 264209
2016-03-23 22:54:19 +00:00
Justin Lebar
d0b286aac1 [CUDA] Update docs to reflect that we no longer define __NVCC__.
llvm-svn: 264208
2016-03-23 22:43:10 +00:00
Justin Bogner
d2783a8964 FAQ: Remove the entire Build Problems section
This is all horribly outdated, and is mostly about the autoconf build
system that doesn't even exist anymore. These questions aren't
frequent, and these answers aren't useful.

llvm-svn: 264141
2016-03-23 06:54:42 +00:00
Justin Bogner
4d8b1ffdf6 FAQ: We require GCC 4.7 - nobody's asking about build failures with 3.3.2
llvm-svn: 264139
2016-03-23 06:38:53 +00:00
Vedant Kumar
bddd5ac701 [docs] Fix typo in ProgrammersManual.rst
Patch by Miod Vallat!

llvm-svn: 264138
2016-03-23 05:18:50 +00:00
Lang Hames
8e8065742d [Docs] Clarify boolean conversion for Error and Expected<T> in the Programmer's
Manual.

llvm-svn: 264135
2016-03-23 03:18:16 +00:00
Sean Silva
688f698b59 [docs] Use reST link.
llvm-svn: 264121
2016-03-23 00:31:21 +00:00
Sean Silva
c6d12ce69a Bring back Makefile.sphinx
It is not part of autoconf and should not have been removed in r258861.

llvm-svn: 264120
2016-03-23 00:30:57 +00:00
Sean Silva
bca15c0956 [docs] Clarify the sense of --compile-command
In retrospect, it seems "obvious" that the sense of the return code is
the same as if it crashed on "interesting" inputs. But that didn't stop
me from spending more time than I care to admit verifying this.

llvm-svn: 264119
2016-03-23 00:25:13 +00:00
Matthias Braun
87b1f010b0 Revert "Support arbitrary addrspace pointers in masked load/store intrinsics"
This commit broke LTO builds. Reverting it to unbreak the bots while the
issue is investigated. See also:

http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160321/341002.html

This reverts r263158

llvm-svn: 264088
2016-03-22 20:24:34 +00:00
Justin Lebar
c038c5cb7c [CUDA] Add documentation explaining how to detect clang vs nvcc.
llvm-svn: 264002
2016-03-21 23:05:15 +00:00
Kostya Serebryany
24b702f5a0 [libFuzzer] one more trophie
llvm-svn: 263868
2016-03-19 01:05:33 +00:00
Chris Bieneman
4f2c8f2700 Fixing autocorrect changing cmake->make
llvm-svn: 263843
2016-03-18 22:11:51 +00:00
Chris Bieneman
6c2dfbbd43 Missed a few non-ascii characters
llvm-svn: 263841
2016-03-18 21:59:33 +00:00
Chris Bieneman
b6aca00b70 Updates based on post-commit review of r263834
* Renamed to be camel case, consistent with other docs.
* Fixed non-ascii characters (this is what I get for writing docs on an iPad).

llvm-svn: 263840
2016-03-18 21:57:51 +00:00
Chris Bieneman
2e59078ff1 [Docs] New documentation for advanced build configurations
This document covers how to use some of the new complex build configurations CMake supports.

Feedback and improvements welcomed!

llvm-svn: 263834
2016-03-18 21:16:26 +00:00
Kostya Serebryany
01af064f8d [libFuzzer] add a flag close_fd_mask so that we can silence spammy targets by closing stderr/stdout
llvm-svn: 263831
2016-03-18 20:58:29 +00:00
Alexey Samsonov
ad015ef58d [Docs] Fix a typo.
llvm-svn: 263754
2016-03-17 23:08:01 +00:00
Wilfred Hughes
7e4b3f2604 Remove obselete reference to TypeResolve from the tutorial.
TypeResolve went away in r134829 in 2011.

llvm-svn: 263702
2016-03-17 10:20:58 +00:00
Wilfred Hughes
29042c2569 Minor grammar fix in kaleidoscope tutorial.
llvm-svn: 263700
2016-03-17 10:18:13 +00:00
Wilfred Hughes
344c39bada Further typo fixes in kaleidoscope tutorial.
llvm-svn: 263697
2016-03-17 09:26:45 +00:00
Wilfred Hughes
54e4e585be Fix typo in kaleidoscope tutorial.
llvm-svn: 263696
2016-03-17 09:09:07 +00:00
Lang Hames
69d7550bd6 [Support] Add the 'Error' class for structured error handling.
This patch introduces the Error classs for lightweight, structured,
recoverable error handling. It includes utilities for creating, manipulating
and handling errors. The scheme is similar to exceptions, in that errors are
described with user-defined types. Unlike exceptions however, errors are
represented as ordinary return types in the API (similar to the way
std::error_code is used).

For usage notes see the LLVM programmer's manual, and the Error.h header.
Usage examples can be found in unittests/Support/ErrorTest.cpp.

Many thanks to David Blaikie, Mehdi Amini, Kevin Enderby and others on the
llvm-dev and llvm-commits lists for lots of discussion and review.

llvm-svn: 263609
2016-03-16 01:02:46 +00:00
Justin Lebar
5b85fcee4a [docs] "Straightforward" is one word.
llvm-svn: 263480
2016-03-14 20:18:51 +00:00
Justin Lebar
94ff383b84 [docs] Fix typo in docs/CodeGenerator.rst.
llvm-svn: 263479
2016-03-14 20:17:08 +00:00
Kostya Serebryany
e89c9a442a [libFuzzer] refresh docs more
llvm-svn: 263332
2016-03-12 03:23:02 +00:00
Kostya Serebryany
7d08a0a22f [libFuzzer] refresh docs more
llvm-svn: 263331
2016-03-12 03:11:27 +00:00
Kostya Serebryany
de5b275333 [libFuzzer] refresh docs more
llvm-svn: 263330
2016-03-12 03:05:37 +00:00
Kostya Serebryany
0f3f323d84 [libFuzzer] refresh docs
llvm-svn: 263328
2016-03-12 02:56:25 +00:00
Kostya Serebryany
5b93d4b15a [libFuzzer] try to use max_len based on the items of the corpus instead of blindly defaulting to 64 bytes.
llvm-svn: 263323
2016-03-12 01:57:04 +00:00
Wilfred Hughes
9acf624f1c Updating source languages entry in FAQ.
Dragonegg is no longer actively maintained[1], and the Pypy team is not
actively pursuing LLVM[2].

1: http://reviews.llvm.org/D9331
2: http://rpython.readthedocs.org/en/latest/faq.html#could-we-use-llvm
llvm-svn: 263314
2016-03-12 00:43:26 +00:00
Chris Matthews
63ebd939a3 Fix the docs I broke
llvm-svn: 263309
2016-03-11 23:31:02 +00:00
Chris Matthews
d6d4e21338 Extend test-suite docs to describe how to run test-suite with cmake+lit
llvm-svn: 263305
2016-03-11 22:33:36 +00:00
Sanjoy Das
3b791814db Introduce @llvm.experimental.deoptimize
Summary:
This intrinsic, together with deoptimization operand bundles, allow
frontends to express transfer of control and frame-local state from
one (typically more specialized, hence faster) version of a function
into another (typically more generic, hence slower) version.

In languages with a fully integrated managed runtime this intrinsic can
be used to implement "uncommon trap" like functionality.  In unmanaged
languages like C and C++, this intrinsic can be used to represent the
slow paths of specialized functions.

Note: this change does not address how `@llvm.experimental_deoptimize`
is lowered.  That will be done in a later change.

Reviewers: chandlerc, rnk, atrick, reames

Subscribers: llvm-commits, kmod, mjacob, maksfb, mcrosier, JosephTremoulet

Differential Revision: http://reviews.llvm.org/D17732

llvm-svn: 263281
2016-03-11 19:08:34 +00:00
Artur Pilipenko
7bad97e2f6 Support arbitrary addrspace pointers in masked load/store intrinsics
This patch fixes the problem which occurs when loop-vectorize tries to use @llvm.masked.load/store intrinsic for a non-default addrspace pointer. It fails with "Calling a function with a bad signature!" assertion in CallInst constructor because it tries to pass a non-default addrspace pointer to the pointer argument which has default addrspace.

The fix is to add pointer type as another overloaded type to @llvm.masked.load/store intrinsics.

Reviewed By: reames

Differential Revision: http://reviews.llvm.org/D17270

llvm-svn: 263158
2016-03-10 20:39:22 +00:00
Mehdi Amini
0bf202262c Add an entry in the Release Notes for LLVMContext::discardValueNames()
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 263088
2016-03-10 02:18:17 +00:00
Hans Wennborg
0d2e26be0c ReleaseNotes: update 'you may prefer' link to 3.8
llvm-svn: 263030
2016-03-09 17:25:34 +00:00
Matt Arsenault
6d86415976 Fix broken example for bitreverse documentation
llvm-svn: 262865
2016-03-07 21:54:52 +00:00
Wilfred Hughes
9703a437cc Fix typo.
llvm-svn: 262802
2016-03-06 12:37:34 +00:00
Alexander Kornienko
719b432be1 [docs] Updated docs to work with Doxygen 1.8.11
llvm-svn: 262786
2016-03-06 03:50:08 +00:00
Sanjoy Das
e0159ebc33 [Statepoint docs] Delete trailing whitespace
llvm-svn: 262730
2016-03-04 18:14:09 +00:00
Philip Reames
347970f4ae [docs] Add a description of current problem areas to the statepoint docs
Triggered by a question on llvm-dev about status

llvm-svn: 262671
2016-03-03 23:24:44 +00:00
Kostya Serebryany
83c604e515 [libFuzzer] more trophies
llvm-svn: 262509
2016-03-02 19:45:10 +00:00
Steven Wu
4a083c7b3a Rename embedded bitcode section in MachO
Summary:
Rename the section embeds bitcode from ".llvmbc,.llvmbc" to "__LLVM,__bitcode".
The new name matches MachO section naming convention.

Reviewers: rafael, pcc

Subscribers: davide, llvm-commits, joker.eph

Differential Revision: http://reviews.llvm.org/D17388

llvm-svn: 262245
2016-02-29 19:40:10 +00:00
Kostya Serebryany
2e7a6d59f7 [libFuzzer] don't emit callbacks to sanitizer run-time in -fsanitize-coverage=trace-pc mode; update libFuzzer doc for previous commit
llvm-svn: 262110
2016-02-27 05:45:12 +00:00
Sanjoy Das
7fc83dcd6e Minor doc fix: statepoints are invokable too
llvm-svn: 261968
2016-02-26 03:33:59 +00:00
Sanjay Patel
d0dcf18d3d fix typo
llvm-svn: 261805
2016-02-24 23:44:19 +00:00
Jingyue Wu
e98e24a50c [doc] Obtaining help on LLVM's CUDA support.
llvm-svn: 261706
2016-02-23 23:34:49 +00:00
Sylvestre Ledru
d91024096e fix the indentation of the example
llvm-svn: 261628
2016-02-23 11:17:27 +00:00
Tom Stellard
f0367cd046 docs/AMDGPUUsage: Update assembly example
Reviewers: arsenm, nhaustov

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17461

llvm-svn: 261550
2016-02-22 18:36:00 +00:00
Chandler Carruth
31c066b76e [LPM] Document the new helpers to make it easy to get consistent require
and preserve behavior from loop passes.

Differential Revision: http://reviews.llvm.org/D17443

llvm-svn: 261319
2016-02-19 10:59:43 +00:00
Philip Reames
2d78d97ccc [IR] Extend cmpxchg to allow pointer type operands
Today, we do not allow cmpxchg operations with pointer arguments. We require the frontend to insert ptrtoint casts and do the cmpxchg in integers. While correct, this is problematic from a couple of perspectives:
1) It makes the IR harder to analyse (for instance, it make capture tracking overly conservative)
2) It pushes work onto the frontend authors for no real gain

This patch implements the simplest form of IR support. As we did with floating point loads and stores, we teach AtomicExpand to convert back to the old representation. This prevents us needing to change all backends in a single lock step change. Over time, we can migrate each backend to natively selecting the pointer type. In the meantime, we get the advantages of a cleaner IR representation without waiting for the backend changes.

Differential Revision: http://reviews.llvm.org/D17413

llvm-svn: 261281
2016-02-19 00:06:41 +00:00
Akira Hatanaka
8d810edb22 Mention 'notail' attribute in 3.9 release notes.
llvm-svn: 261141
2016-02-17 19:35:47 +00:00
Justin Lebar
82b56ffe65 Update langref to indicate that calls may be convergent.
Summary:
As previously written, only functions could be convergent.  But calls
need to have a notion of convergence as well.

To see why this is important, consider an indirect call.  We may or may
not want to disable optimizations around it and behave as though we're
calling a convergent function -- it depends on the semantics of the
language we're compiling.  Thus the need for this attr on the call.

Reviewers: jingyue, joker.eph

Subscribers: llvm-commits, tra, jhen, arsenm, chandlerc, hfinkel, resistor

Differential Revision: http://reviews.llvm.org/D17314

llvm-svn: 261111
2016-02-17 17:46:41 +00:00
Amaury Sechet
18a44b5a3c Deprecate LLVMGetDataLayout and replace it by LLVMGetDataLayoutStr
Summary: The name is confusing as it matche another method on the module.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D17283

llvm-svn: 260920
2016-02-16 00:23:52 +00:00
Amaury Sechet
c4e8893256 Kill LLVMAddTargetData
Summary: It's red, it's dead.

Reviewers: joker.eph, Wallbraker, echristo

Subscribers: llvm-commits, axw

Differential Revision: http://reviews.llvm.org/D17282

llvm-svn: 260919
2016-02-16 00:22:02 +00:00
Sylvestre Ledru
71d7778dd2 Fix some typos in the llvm doc
llvm-svn: 260855
2016-02-14 20:16:22 +00:00
Rafael Espindola
36d363a08a Delete the deprecated LLVMLinkModules.
llvm-svn: 260683
2016-02-12 15:28:45 +00:00
Mehdi Amini
59261c912a C API: Remove LLVMGetDataLayout that was deprecated in 3.7
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 260657
2016-02-12 06:22:00 +00:00
Mark Lacey
aac7bd2baf Fix minor error with debug info doc.
Replace 'third' with 'fourth' in the description of the fourth argument.

llvm-svn: 260656
2016-02-12 06:19:16 +00:00
James Y Knight
5460ff3ee3 Add -match-full-lines argument to FileCheck.
This is useful for some tests where more-exact matching is useful, such
as clang's Preprocessor tests.

llvm-svn: 260540
2016-02-11 16:46:09 +00:00
Hemant Kulkarni
bb26477ebd [llvm-nm] Add -radix option
Differential Revision: http://reviews.llvm.org/D16822

llvm-svn: 260392
2016-02-10 17:51:39 +00:00
Tim Northover
c74a4e9807 ARM: improve documentation slightly.
It seems the ARMv8 instruction set overview is no longer provided by ARM, so
I've removed it. Since most of the other documents were the same I unified the
two sections.

llvm-svn: 260329
2016-02-09 23:55:48 +00:00
Justin Lebar
6380a76968 Update documentation about convergent attribute.
Summary:
Be more explicit about what 'convergent' means, and indicate that the
compiler may remove the attribute from a function if it can prove that
the function doesn't in fact execute any convergent ops.

Reviewers: resistor, jingyue, joker.eph

Subscribers: hfinkel, chandlerc, arsenm, jhen, tra, llvm-commits

Differential Revision: http://reviews.llvm.org/D17012

llvm-svn: 260318
2016-02-09 23:03:17 +00:00
Justin Bogner
974dab4e8f cmake: Accept "thin" or "full" as arguments to -DLLVM_ENABLE_LTO
Mehdi suggested in a review of r259766 that it's also useful to easily
set the type of LTO. Augment the cmake variable to support that.

llvm-svn: 260143
2016-02-08 21:01:24 +00:00
Hans Wennborg
36d0cb3fd9 [X86] Don't zero/sign-extend i1, i8, or i16 return values to 32 bits (PR22532)
This matches GCC and MSVC's behaviour, and saves on code size.

We were already not extending i1 return values on x86_64 after r127766. This
takes that patch further by applying it to x86 target as well, and also for i8
and i16.

The ABI docs have been unclear about the required behaviour here. The new i386
psABI [1] clearly states (Table 2.4, page 14) that i1, i8, and i16 return
vales do not need to be extended beyond 8 bits. The x86_64 ABI doc is being
updated to say the same [2].

Differential Revision: http://reviews.llvm.org/D16907

 [1]. https://01.org/sites/default/files/file_attach/intel386-psabi-1.0.pdf
 [2]. https://groups.google.com/d/msg/x86-64-abi/E8O33onbnGQ/_RFWw_ixDQAJ

llvm-svn: 260133
2016-02-08 19:34:30 +00:00
Xinliang David Li
a698273397 [PGO] Enable compression in pgo instrumentation
This reduces sizes of instrumented object files, final binaries,
process images, and raw profile data.

The format of the indexed profile data remain the same.

Differential Revision: http://reviews.llvm.org/D16388 
 

llvm-svn: 260117
2016-02-08 18:13:49 +00:00
Keno Fischer
77a4114ed0 [docs] Add a note that the Visual Studio C++ tools are required
Watching new contributors trying to build LLVM on Windows, one of the
very common failure modes was getting a version of Visual Studio
that did not have a C++ compiler for CMake to put up. Trying to create
a C++ project in Visual Studio will cause Visual Studio to go and
download the C++ tools.

llvm-svn: 260049
2016-02-07 19:36:54 +00:00
Philip Reames
35a39a4d06 [docs] Remove now confusing references to cofigure/autoconf
llvm-svn: 260042
2016-02-07 16:35:04 +00:00
Philip Reames
f0095ac08c [docs] Wordsmithing to program layout descriptio in GettingStarted
This just incrementally improves what was already there; it's questionable whether this content belongs in the getting started guide at all.

Patch by Ben Nathanson w/permission w/minor edtis by me.

llvm-svn: 260040
2016-02-07 16:23:32 +00:00
Philip Reames
4faa115d63 [docs] Clarify disk space usage of debug builds
llvm-svn: 260039
2016-02-07 15:58:35 +00:00
Philip Reames
3624191572 [docs] Remove a stale and confusing section from GettingStarted
The mentioned environment variable doesn't appear to have any use in the LLVM repository.  If it is still relevant for clang, we can consider adding it to the clang getting started page.

Patch inspired by documentation work by Ben Nathanson at the LLVM Bloomberg sprint.

llvm-svn: 260037
2016-02-07 15:49:57 +00:00
Philip Reames
f203422a1f [docs] Update the docs to describe how to build the docs with cmake
llvm-svn: 260035
2016-02-07 15:42:12 +00:00
Duncan P. N. Exon Smith
8c593fce2c LangRef: Fix example code for cmpxchg
Patch by Daniel Robertson!

llvm-svn: 260018
2016-02-07 05:06:35 +00:00
Philip Reames
06fe5a7928 [docs] Warn against slow serial builds
llvm-svn: 260006
2016-02-06 19:43:40 +00:00
Philip Reames
70109069d9 [docs] Redirect new contributors to the right starting point
llvm-svn: 260004
2016-02-06 19:29:23 +00:00
Philip Reames
915d09ef04 [docs] Clarify a couple of getting started issues identified during Sprint
llvm-svn: 260003
2016-02-06 19:20:26 +00:00
Ashutosh Nema
130a57dd42 Fixed short underline error in LangRef.rst for recently added
metadata 'llvm.loop.licm_versioning.disable' description.

llvm-svn: 259988
2016-02-06 09:24:37 +00:00
Ashutosh Nema
d6dcbf971a New Loop Versioning LICM Pass
Summary:
When alias analysis is uncertain about the aliasing between any two accesses,
it will return MayAlias. This uncertainty from alias analysis restricts LICM
from proceeding further. In cases where alias analysis is uncertain we might
use loop versioning as an alternative.

Loop Versioning will create a version of the loop with aggressive aliasing
assumptions in addition to the original with conservative (default) aliasing
assumptions. The version of the loop making aggressive aliasing assumptions
will have all the memory accesses marked as no-alias. These two versions of
loop will be preceded by a memory runtime check. This runtime check consists
of bound checks for all unique memory accessed in loop, and it ensures the
lack of memory aliasing. The result of the runtime check determines which of
the loop versions is executed: If the runtime check detects any memory
aliasing, then the original loop is executed. Otherwise, the version with
aggressive aliasing assumptions is used.

The pass is off by default and can be enabled with command line option 
-enable-loop-versioning-licm.

Reviewers: hfinkel, anemet, chatur01, reames

Subscribers: MatzeB, grosser, joker.eph, sanjoy, javed.absar, sbaranga,
             llvm-commits

Differential Revision: http://reviews.llvm.org/D9151

llvm-svn: 259986
2016-02-06 07:47:48 +00:00
Vedant Kumar
97ba04777b [docs] Fix typo in YamlIO.rst
Patch by Mario Lang!

llvm-svn: 259825
2016-02-04 20:42:43 +00:00
Niels Ole Salscheider
a0cd125976 Install cmake files to lib/cmake/llvm
This is the right location for platform-specific files.

On some distributions (e. g. Exherbo), a package can be installed for several
architectures in parallel, but the architecture-independent files are shared.
Therefore, we must not install architecture-dependent files (like the CMake
config and export files) to share/.

llvm-svn: 259821
2016-02-04 20:08:19 +00:00
Justin Bogner
d393294b5b cmake: Add a flag to enable LTO
This adds -DLLVM_ENABLE_LTO, rather than forcing people to manually
add -flto to the various _FLAGS variables.

llvm-svn: 259766
2016-02-04 07:28:30 +00:00
Peter Collingbourne
7306e68b47 docs: Document how bitsets may be used to encode type information.
llvm-svn: 259619
2016-02-03 02:01:08 +00:00
Kostya Serebryany
4b2ab57d9f [libFuzzer] allow passing 1 or more files as individual inputs
llvm-svn: 259459
2016-02-02 03:03:47 +00:00
Jingyue Wu
8437a2db93 [doc] improve the doc for CUDA
1. Mentioned that CUDA support works best with trunk.
2. Simplified the example by removing its dependency on the CUDA samples.
3. Explain the --cuda-gpu-arch flag.

llvm-svn: 259307
2016-01-30 23:48:47 +00:00
Alexey Samsonov
9edefbf4bf [docs] Remove references to autotools build.
llvm-svn: 259280
2016-01-30 01:10:15 +00:00
Kostya Serebryany
e3ec64cf18 [libFuzzer] add -timeout_exitcode option
llvm-svn: 259265
2016-01-29 23:30:07 +00:00
Vedant Kumar
e1a3d86600 [Profiling] Add a -sparse mode to llvm-profdata merge
Add an option to llvm-profdata merge for writing out sparse indexed
profiles. These profiles omit InstrProfRecords for functions which are
never executed.

Differential Revision: http://reviews.llvm.org/D16727

llvm-svn: 259258
2016-01-29 22:54:45 +00:00
Xinliang David Li
481a5b6efe [Coverage] Fix more bugs in covmap V1 documentation
llvm-svn: 258906
2016-01-27 03:13:09 +00:00
Sanjoy Das
6928292c87 [docs] Fix a typo
llvm-svn: 258878
2016-01-26 23:26:25 +00:00
Chris Bieneman
878804b783 Fixing the documentation builds
I broke the documentation builds when I deleted the MakefileGuide as part of the autoconf removal. At some point I'll need to do a more in-depth pass updating the documentation to remove references to the old build system.

llvm-svn: 258873
2016-01-26 22:53:12 +00:00
Chris Bieneman
1b8d4f74aa Remove autoconf support
Summary:
This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html

"I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened."
- Obi Wan Kenobi

Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark

Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D16471

llvm-svn: 258861
2016-01-26 21:29:08 +00:00
Hemant Kulkarni
e89fec8eee [llvm-readobj] Add -elf-section-groups option
Adds a way to inspect SHT_GROUP sections in ELF objects.
Displays signature, member sections of these sections.

Differential revision: http://reviews.llvm.org/D16555

llvm-svn: 258845
2016-01-26 19:46:39 +00:00
Matt Arsenault
31798fd428 AMDGPU: Note mesa version in release notes
llvm-svn: 258784
2016-01-26 04:29:15 +00:00
Vedant Kumar
b5f67b4e31 [docs] Document how to merge patches into release branches
llvm-svn: 258736
2016-01-25 22:47:54 +00:00
Kostya Serebryany
0c11655f17 [libFuzzer] add -abort_on_timeout option
llvm-svn: 258631
2016-01-23 19:34:19 +00:00
Sanjoy Das
b0b3d4c99d Add a "gc-transition" operand bundle
Summary:
This adds a new kind of operand bundle to LLVM denoted by the
`"gc-transition"` tag.  Inputs to `"gc-transition"` operand bundle are
lowered into the "transition args" section of `gc.statepoint` by
`RewriteStatepointsForGC`.

This removes the last bit of functionality that was unsupported in the
deopt bundle based code path in `RewriteStatepointsForGC`.

Reviewers: pgavlin, JosephTremoulet, reames

Subscribers: sanjoy, mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D16342

llvm-svn: 258338
2016-01-20 19:50:25 +00:00
Andrew Wilkins
2e451b76ef docs: address post-commit review
Rewording/expansion of CMake options
suggested by Dan Liew.

See http://reviews.llvm.org/D16208.

llvm-svn: 258112
2016-01-19 05:43:21 +00:00
Kostya Serebryany
d65aa3494d [libFuzzer] introduce LLVMFuzzerInitialize
llvm-svn: 257980
2016-01-16 01:23:12 +00:00
Andrew Wilkins
4a20fbee68 [docs] Document LLVM_{BUILD,LINK}_LLVM_DYLIB
Summary:
Document the LLVM_BUILD_LLVM_DYLIB and LLVM_LINK_LLVM_DYLIB
CMake options, move BUILD_SHARED_LIBS out of frequently-used,
and add a note/warning to BUILD_SHARED_LIBS.

Reviewers: beanz, delcypher, mjacob

Subscribers: mjacob, llvm-commits

Differential Revision: http://reviews.llvm.org/D16208

llvm-svn: 257864
2016-01-15 03:33:35 +00:00
Philip Reames
25079dcd59 [docs] Restructure description of records created by Statepoints
The previous text was hard to understand even for me and I wrote it.  Hopefully the new structure makes it a bit more clear what's going on.  If anyone has word smithing suggestion or clarification questions, please let me know.

llvm-svn: 257847
2016-01-15 00:13:39 +00:00
Philip Reames
0562612789 [docs] Update Statepoint docs to clarify format for recent changes
llvm-svn: 257843
2016-01-14 23:58:18 +00:00
Dan Liew
8f2866d9c0 [docs] Improve the documentation on committing code reviewed on
Phabricator to trunk.

The previous documentation had a few issues:

* It did not make it explicit that code could be
committed without using the Arcanist tool and how this should be done.

* There was also an implicit assumption on using Subversion
rather than git-svn in the example using Arcanist. The documentation now
explicitly mentions both cases and details how to commit to trunk in
each case.

Reviewers: klimek, probinson

Subscribers: probinson, nwilson, reames, llvm-commits

Differential Revision: http://reviews.llvm.org/D15801

llvm-svn: 257764
2016-01-14 13:39:29 +00:00
Hans Wennborg
81c78f96e1 Unbreak the sphinx build
llvm-svn: 257659
2016-01-13 19:33:49 +00:00
Hans Wennborg
63448e6292 Update version to 3.9.
llvm-svn: 257627
2016-01-13 17:32:32 +00:00
Sanjay Patel
e1467c9680 fix typo
llvm-svn: 257617
2016-01-13 16:46:41 +00:00
Sanjay Patel
cce92b59e3 fix typo
llvm-svn: 257611
2016-01-13 16:30:44 +00:00
JF Bastien
78927c1cdb Doc fix: code-quote load / store doc the same way
llvm-svn: 257573
2016-01-13 04:52:26 +00:00
Christof Douma
8c7f4f56f2 The --debug-only option now takes a comma separated list of debug types.
This means that the DEBUG_TYPE cannot take a comma anymore. All existing passes
conform to this rule.

Differential Revision: http://reviews.llvm.org/D15645

llvm-svn: 257466
2016-01-12 10:23:13 +00:00
Reid Kleckner
cbda36e6e5 Update the VS getting started docs to reflect the current state of support
llvm-svn: 257381
2016-01-11 20:51:57 +00:00
Joseph Tremoulet
c7152d63e1 [LangRef] Move catchpad to "Other Operators" (NFC)
It is no longer a terminator, so should no longer be grouped with them.

llvm-svn: 257276
2016-01-10 04:46:10 +00:00
Joseph Tremoulet
4ce108b7e0 [WinEH] Disallow cyclic unwinds
Summary:
Funclet-based EH personalities/tables likely can't handle these, and they
can't be generated at source, so make them officially illegal in IR as
well.


Reviewers: andrew.w.kaylor, rnk, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15963

llvm-svn: 257274
2016-01-10 04:31:05 +00:00
Joseph Tremoulet
873c99e940 [WinEH] Verify consistent funclet unwind exits
Summary:
A funclet EH pad may be exited by an unwind edge, which may be a
cleanupret exiting its cleanuppad, an invoke exiting a funclet, or an
unwind out of a nested funclet transitively exiting its parent.  Funclet
EH personalities require all such exceptional exits from a given funclet to
have the same unwind destination, and EH preparation / state numbering /
table generation implicitly depends on this.  Formalize it as a rule of
the IR in the LangRef and verifier.


Reviewers: rnk, majnemer, andrew.w.kaylor

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15962

llvm-svn: 257273
2016-01-10 04:30:02 +00:00
Joseph Tremoulet
c511cef4af [WinEH] Verify unwind edges against EH pad tree
Summary:
Funclet EH personalities require a tree-like nesting among funclets
(enforced by the ParentPad linkage in the IR), and also require that
unwind edges conform to certain rules with respect to the tree:
 - An unwind edge may exit 0 or more ancestor pads
 - An unwind edge must enter exactly one EH pad, which must be distinct
   from any exited pads
 - A cleanupret's edge must exit its cleanuppad

Describe these rules in the LangRef, and enforce them in the verifier.


Reviewers: rnk, majnemer, andrew.w.kaylor

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15961

llvm-svn: 257272
2016-01-10 04:28:38 +00:00
Paul Robinson
9d304ad552 How to close a review manually.
llvm-svn: 257180
2016-01-08 17:05:12 +00:00
Mike Aizatsky
a5855c0f74 [llvm-symbolizer] Print out non-address lines verbatim.
Differential Revision: http://reviews.llvm.org/D15876

llvm-svn: 257115
2016-01-07 23:57:41 +00:00
Xinliang David Li
88f1bad0de More fix to coverage documentation
llvm-svn: 256895
2016-01-06 01:23:41 +00:00
Eric Christopher
e81d5fcd14 Update docs to recommend CMake >= v3.2.
CMake v3.2 or newer is necessary to get interactive output when running
Lit via Ninja. Otherwise Ninja will buffer Lit's output, which makes
for a crummy experience -- you can't tell if your tests are hung!

Patch by Justin Lebar!

llvm-svn: 256791
2016-01-04 23:22:43 +00:00
Xinliang David Li
0b0ec3db86 Update documantation
llvm-svn: 256774
2016-01-04 20:00:47 +00:00
Dimitry Andric
0614f2a55e Fix several accidental DOS line endings in source files
Summary:
There are a number of files in the tree which have been accidentally checked in with DOS line endings.  Convert these to native line endings.

There are also a few files which have DOS line endings on purpose, and I have set the svn:eol-style property to 'CRLF' on those.

Reviewers: joerg, aaron.ballman

Subscribers: aaron.ballman, sanjoy, dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D15848

llvm-svn: 256707
2016-01-03 17:22:03 +00:00
Chen Li
c60ad3e1fe [gc.statepoint] Change gc.statepoint intrinsic's return type to token type instead of i32 type
Summary: This patch changes gc.statepoint intrinsic's return type to token type instead of i32 type. Using token types could prevent LLVM to merge different gc.statepoint nodes into PHI nodes and cause further problems with gc relocations. The patch also changes the way on how gc.relocate and gc.result look for their corresponding gc.statepoint on unwind path. The current implementation uses the selector value extracted from a { i8*, i32 } landingpad as a hook to find the gc.statepoint, while the patch directly uses a token type landingpad (http://reviews.llvm.org/D15405) to find the gc.statepoint. 

Reviewers: sanjoy, JosephTremoulet, pgavlin, igor-laevsky, mjacob

Subscribers: reames, mjacob, sanjoy, llvm-commits

Differential Revision: http://reviews.llvm.org/D15662

llvm-svn: 256443
2015-12-26 07:54:32 +00:00
Paul Robinson
70ef8b0ecf Add advice on choosing reviewers
llvm-svn: 256265
2015-12-22 18:59:02 +00:00
NAKAMURA Takumi
c8ebe717f8 [Cygwin] Enable TLS as emutls.
It resolves clang selfhosting with std::once() for Cygwin.

FIXME: It may be EmulatedTLS-generic also for X86-Android.
FIXME: Pass EmulatedTLS to LLVM CodeGen from Clang with -femulated-tls.
llvm-svn: 256134
2015-12-21 02:37:23 +00:00
Rafael Espindola
2959fcb59a Delete APIs that have been deprecated since 2010.
llvm-svn: 256107
2015-12-19 21:42:07 +00:00
Kostya Serebryany
4165eed18e [libFuzzer] deprecate -save_minimized_corpus, -merge can be used instead
llvm-svn: 256086
2015-12-19 03:42:16 +00:00
Rafael Espindola
e392243a54 Deprecate a few C APIs.
This deprecates:
* LLVMParseBitcode
* LLVMParseBitcodeInContext
* LLVMGetBitcodeModuleInContext
* LLVMGetBitcodeModule

They are replaced with the functions with a 2 suffix which do not record
a diagnostic.

llvm-svn: 256065
2015-12-18 23:46:42 +00:00
Eric Christopher
359dea2a6b Reorganize the C API headers to improve build times.
Type specific declarations have been moved to Type.h and error handling
routines have been moved to ErrorHandling.h. Both are included in Core.h
so nothing should change for projects directly including the headers,
but transitive dependencies may be affected.

llvm-svn: 255965
2015-12-18 01:46:52 +00:00
JF Bastien
4730f05bb8 Polish atomic pointers
Summary:
I didn't realize that we already allowed atomic load/store of pointers,
it was added in 2012 by r162146. This patch updates the documentation
and tightens the verifier by using DataLayout to make sure that the
stored size is byte-sized and power-of-two. DataLayout is also used for
integers, and while I'm here I updated the corresponding code for
cmpxchg and rmw.

See the following discussion for context and upcoming changes to
add floating-point and vector atomics:
  https://groups.google.com/forum/#!topic/llvm-dev/Nh0P_E3CRoo/discussion

Reviewers: reames

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D15512

llvm-svn: 255931
2015-12-17 22:09:19 +00:00
Rafael Espindola
a58ac64571 Drop function that are deprecated since 2010.
These functions were deprecated in r97608.

llvm-svn: 255927
2015-12-17 21:16:12 +00:00
Vedant Kumar
4246c5ed60 [docs] Motivate ninja in GettingStarted.rst
llvm-svn: 255924
2015-12-17 20:49:48 +00:00
Rafael Espindola
f7a0054c75 Change linkInModule to take a std::unique_ptr.
Passing in a std::unique_ptr should help find errors when the module
is used after being linked into another module.

llvm-svn: 255842
2015-12-16 23:16:33 +00:00
Vaivaswatha Nagaraj
a478a7d3d6 Add InaccessibleMemOnly and inaccessibleMemOrArgMemOnly attributes
Summary:
This patch introduces two new function attributes 

InaccessibleMemOnly: This attribute indicates that the function may only access memory that is not accessible by the program/IR being compiled. This is a weaker form of ReadNone.
inaccessibleMemOrArgMemOnly: This attribute indicates that the function may only access memory that is either not accessible by the program/IR being compiled, or is pointed to by its pointer arguments. This is a weaker form of  ArgMemOnly

Test cases have been updated. This revision uses this (d001932f3a) as reference.

Reviewers: jmolloy, hfinkel

Subscribers: reames, joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D15499

llvm-svn: 255778
2015-12-16 16:16:19 +00:00
Philip Reames
d32c9d5ac8 [IR] Add support for floating pointer atomic loads and stores
This patch allows atomic loads and stores of floating point to be specified in the IR and adds an adapter to allow them to be lowered via existing backend support for bitcast-to-equivalent-integer idiom.

Previously, the only way to specify a atomic float operation was to bitcast the pointer to a i32, load the value as an i32, then bitcast to a float. At it's most basic, this patch simply moves this expansion step to the point we start lowering to the backend.

This patch does not add canonicalization rules to convert the bitcast idioms to the appropriate atomic loads. I plan to do that in the future, but for now, let's simply add the support. I'd like to get instruction selection working through at least one backend (x86-64) without the bitcast conversion before canonicalizing into this form.

Similarly, I haven't yet added the target hooks to opt out of the lowering step I added to AtomicExpand. I figured it would more sense to add those once at least one backend (x86) was ready to actually opt out.

As you can see from the included tests, the generated code quality is not great. I plan on submitting some patches to fix this, but help from others along that line would be very welcome. I'm not super familiar with the backend and my ramp up time may be material.

Differential Revision: http://reviews.llvm.org/D15471

llvm-svn: 255737
2015-12-16 00:49:36 +00:00
David Majnemer
608538dccc [WinEH] Use operand bundles to describe call sites
SimplifyCFG allows tail merging with code which terminates in
unreachable which, in turn, makes it possible for an invoke to end up in
a funclet which it was not originally part of.

Using operand bundles on invokes allows us to determine whether or not
an invoke was part of a funclet in the source program.

Furthermore, it allows us to unambiguously answer questions about the
legality of inlining into call sites which the personality may have
trouble with.

Differential Revision: http://reviews.llvm.org/D15517

llvm-svn: 255674
2015-12-15 21:27:27 +00:00
Alex Denisov
50b81b59c2 LLVM tutorial: fix broken links/anchors
llvm-svn: 255671
2015-12-15 20:50:29 +00:00
Akira Hatanaka
9aec9dadd0 [Docs] Fix Unexpected indentation errors.
llvm-svn: 255665
2015-12-15 19:11:48 +00:00
Nathan Slingerland
b95c2eec31 [llvm-profdata] Add support for weighted merge of profile data (2nd try)
Summary:
This change adds support for specifying a weight when merging profile data with the llvm-profdata tool.
Weights are specified by using the --weighted-input=<weight>,<filename> option. Input files not specified
with this option (normal positional list after options) are given a default weight of 1.

Adding support for arbitrary weighting of input profile data allows for relative importance to be placed on the
input data from multiple training runs.

Both sampled and instrumented profiles are supported.

Reviewers: davidxl, dnovillo, bogner, silvas

Subscribers: silvas, davidxl, llvm-commits

Differential Revision: http://reviews.llvm.org/D15306

llvm-svn: 255659
2015-12-15 17:37:09 +00:00
Sanjay Patel
14a74b66f7 add fast-math-flags to 'call' instructions (PR21290)
This patch adds optional fast-math-flags (the same that apply to fmul/fadd/fsub/fdiv/frem/fcmp)
to call instructions in IR. Follow-up patches would use these flags in LibCallSimplifier, add 
support to clang, and extend FMF to the DAG for calls.

Motivating example:

%y = fmul fast float %x, %x
%z = tail call float @sqrtf(float %y)

We'd like to be able to optimize sqrt(x*x) into fabs(x). We do this today using a function-wide
attribute for unsafe-math, but we really want to trigger on the instructions themselves:

%z = tail call fast float @sqrtf(float %y)

because in an LTO build it's possible that calls with fast semantics have been inlined into a
function with non-fast semantics.

The code changes and tests are based on the recent commits that added "notail":
http://reviews.llvm.org/rL252368

and added FMF to fcmp:
http://reviews.llvm.org/rL241901

Differential Revision: http://reviews.llvm.org/D14707

llvm-svn: 255555
2015-12-14 21:59:03 +00:00
Peter Collingbourne
3ad596a73f docs: Correct wording in LangRef relating to available_externally linkage.
Differential Revision: http://reviews.llvm.org/D15343

llvm-svn: 255534
2015-12-14 19:22:37 +00:00
David Majnemer
49dcd13916 [IR] Remove terminatepad
It turns out that terminatepad gives little benefit over a cleanuppad
which calls the termination function.  This is not sufficient to
implement fully generic filters but MSVC doesn't support them which
makes terminatepad a little over-designed.

Depends on D15478.

Differential Revision: http://reviews.llvm.org/D15479

llvm-svn: 255522
2015-12-14 18:34:23 +00:00
Akira Hatanaka
b2c2db60ff [Docs] Fix underlines that were too short or too long.
llvm-svn: 255480
2015-12-14 05:15:40 +00:00
David Majnemer
8a1dde1744 Try to appease sphinx
llvm-svn: 255429
2015-12-12 06:56:02 +00:00
David Majnemer
bf189bdcd7 [IR] Reformulate LLVM's EH funclet IR
While we have successfully implemented a funclet-oriented EH scheme on
top of LLVM IR, our scheme has some notable deficiencies:
- catchendpad and cleanupendpad are necessary in the current design
  but they are difficult to explain to others, even to seasoned LLVM
  experts.
- catchendpad and cleanupendpad are optimization barriers.  They cannot
  be split and force all potentially throwing call-sites to be invokes.
  This has a noticable effect on the quality of our code generation.
- catchpad, while similar in some aspects to invoke, is fairly awkward.
  It is unsplittable, starts a funclet, and has control flow to other
  funclets.
- The nesting relationship between funclets is currently a property of
  control flow edges.  Because of this, we are forced to carefully
  analyze the flow graph to see if there might potentially exist illegal
  nesting among funclets.  While we have logic to clone funclets when
  they are illegally nested, it would be nicer if we had a
  representation which forbade them upfront.

Let's clean this up a bit by doing the following:
- Instead, make catchpad more like cleanuppad and landingpad: no control
  flow, just a bunch of simple operands;  catchpad would be splittable.
- Introduce catchswitch, a control flow instruction designed to model
  the constraints of funclet oriented EH.
- Make funclet scoping explicit by having funclet instructions consume
  the token produced by the funclet which contains them.
- Remove catchendpad and cleanupendpad.  Their presence can be inferred
  implicitly using coloring information.

N.B.  The state numbering code for the CLR has been updated but the
veracity of it's output cannot be spoken for.  An expert should take a
look to make sure the results are reasonable.

Reviewers: rnk, JosephTremoulet, andrew.w.kaylor

Differential Revision: http://reviews.llvm.org/D15139

llvm-svn: 255422
2015-12-12 05:38:55 +00:00
Hal Finkel
e58db13c29 Revert r248483, r242546, r242545, and r242409 - absdiff intrinsics
After much discussion, ending here:

  http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151123/315620.html

it has been decided that, instead of having the vectorizer directly generate
special absdiff and horizontal-add intrinsics, we'll recognize the relevant
reduction patterns during CodeGen. Accordingly, these intrinsics are not needed
(the operations they represent can be pattern matched, as is already done in
some backends). Thus, we're backing these out in favor of the current
development work.

r248483 - Codegen: Fix llvm.*absdiff semantic.
r242546 - [ARM] Use [SU]ABSDIFF nodes instead of intrinsics for VABD/VABA
r242545 - [AArch64] Use [SU]ABSDIFF nodes instead of intrinsics for ABD/ABA
r242409 - [Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation

llvm-svn: 255387
2015-12-11 23:11:52 +00:00
Eric Christopher
b4999f7af6 Fix a spurious if.
llvm-svn: 255321
2015-12-11 00:51:59 +00:00
Eric Christopher
5f9e955382 s/need/needs
llvm-svn: 255306
2015-12-10 22:29:26 +00:00
Eric Christopher
486717bbd5 Attempt to fix the ReST compilation to html of the C API docs.
llvm-svn: 255304
2015-12-10 22:04:11 +00:00
Eric Christopher
9456f0c8a7 More non-ascii quote characters.
llvm-svn: 255303
2015-12-10 21:47:38 +00:00
Eric Christopher
4d1733dc41 Clarify some of the wording on adding a new subcomponent to the
C API.

llvm-svn: 255302
2015-12-10 21:46:24 +00:00
Eric Christopher
cb61a69d4f Fix non-ascii quotes.
llvm-svn: 255301
2015-12-10 21:38:56 +00:00
Eric Christopher
40a2fd91c0 Add C API guidelines to the developer policy to match discussions
on the llvm mailing lists.

llvm-svn: 255300
2015-12-10 21:33:53 +00:00
Amjad Aboud
85f2758759 Macro debug info support in LLVM IR
Introduced DIMacro and DIMacroFile debug info metadata in the LLVM IR to support macros.

Differential Revision: http://reviews.llvm.org/D14687

llvm-svn: 255245
2015-12-10 12:56:35 +00:00
Alexey Bataev
f26d973dc0 [OPENMP] Make -fopenmp to turn on OpenMP support by default.
Patch turns on OpenMP support in clang by default after fixing OpenMP buildbots.
Differential Revision: http://reviews.llvm.org/D13802

llvm-svn: 255222
2015-12-10 05:45:58 +00:00
Manman Ren
dacd6a7c5f Update doc for C++ TLS calling convention.
llvm-svn: 254953
2015-12-07 21:40:09 +00:00