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

5909 Commits

Author SHA1 Message Date
Rafael Espindola
1794435a31 Start adding documentation for llvm-lib.
llvm-svn: 242557
2015-07-17 18:49:26 +00:00
Peter Zotov
d8604d794a [OCaml] Use a nicer style for documentation than OCaml default.
In particular, it's much easier to read, as it doesn't expand all
the way on wide-screen displays.

CSS committed under LLVM license with explicit permission from
Daniel Bünzli <daniel.buenzli@erratique.ch>.

llvm-svn: 242511
2015-07-17 06:37:59 +00:00
Philip Reames
bd417e52c5 List supported architectures for StackMap section and related intrinsics
Not having this documented led to some confusion in a recent review thread.

llvm-svn: 242441
2015-07-16 21:10:46 +00:00
James Molloy
fbd5dd7f96 [Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation
This adds new intrinsics "*absdiff" for absolute difference ops to facilitate efficient code generation for "sum of absolute differences" operation.
The patch also contains the introduction of corresponding SDNodes and basic legalization support.Sanity of the generated code is tested on X86.

This is 1st of the three patches.

Patch by Shahid Asghar-ahmad!

llvm-svn: 242409
2015-07-16 15:22:46 +00:00
Hans Wennborg
ff7f4d08cf Fix Sphinx error about duplicate label in CommandLine.rst:1560 and CoverageMappingFormat.rst
llvm-svn: 242245
2015-07-14 23:29:53 +00:00
Hans Wennborg
14d7f81d7e ReleaseNotes.rst: Bump version to 3.8
The notes for 3.7 are on the 3.7 branch.

llvm-svn: 242237
2015-07-14 22:49:27 +00:00
Hans Wennborg
d9755423dc Update the trunk version to 3.8.0svn.
llvm-svn: 242222
2015-07-14 22:35:57 +00:00
Hal Finkel
2a88231c40 [PowerPC] Use the ABI indirect-call protocol for patchpoints
We used to take the address specified as the direct target of the patchpoint
and did no TOC-pointer handling.  This, however, as not all that useful,
because MCJIT tends to create a lot of modules, and they have their own TOC
sections. Thus, to call from the generated code to other generated code, you
really need to switch TOC pointers. Make this work as expected, and under
ELFv1, tread the address as the function descriptor address so that the correct
TOC pointer can be loaded.

llvm-svn: 242217
2015-07-14 22:26:06 +00:00
Daniel Sanders
01dbeab210 [mips] Explained the 'w' modifier in the Inline Assembler documentation.
It exists for compatibility with GCC which requires it to print MSA registers
for the 'f' constraint. Although LLVM doesn't need it, the 'w' modifier should
still be used for portability between the two compilers.

llvm-svn: 242015
2015-07-13 09:24:21 +00:00
Yaron Keren
ded186e457 Fix PR24099 reported by Tomas Brukner.
llvm-svn: 241997
2015-07-12 20:40:41 +00:00
Igor Laevsky
05bff16edd Add argmemonly attribute.
This change adds new attribute called "argmemonly". Function marked with this attribute can only access memory through it's argument pointers. This attribute directly corresponds to the "OnlyAccessesArgumentPointees" ModRef behaviour in alias analysis.

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

llvm-svn: 241979
2015-07-11 10:30:36 +00:00
Owen Anderson
c4c85c5ebc Define a new intrinsic @llvm.canonicalize.
This is used the canonicalize floating point values, which is useful for
implementing certain numeric primitives.  See the LangRef changes for
the full details of its semantics.

llvm-svn: 241977
2015-07-11 07:01:27 +00:00
James Molloy
4008b8e3dc Add support for fast-math flags to the FCmp instruction.
FCmp behaves a lot like a floating-point binary operator in many ways,
and can benefit from fast-math information. Flags such as nsz and nnan
can affect if this fcmp (in combination with a select) can be treated
as a fminnum/fmaxnum operation.

This adds backwards-compatible bitcode support, IR parsing and writing,
LangRef changes and IRBuilder changes. I'll need to audit InstSimplify
and InstCombine in a followup to find places where flags should be
copied.

llvm-svn: 241901
2015-07-10 12:52:00 +00:00
David Majnemer
80ac5e60bf Revert the new EH instructions
This reverts commits r241888-r241891, I didn't mean to commit them.

llvm-svn: 241893
2015-07-10 07:15:17 +00:00
David Majnemer
41cca746cd Address Joseph's review comments.
llvm-svn: 241890
2015-07-10 07:01:03 +00:00
David Majnemer
8f0e15d0b5 Address Reid's review feedback.
llvm-svn: 241889
2015-07-10 07:00:58 +00:00
David Majnemer
6310e08ce2 New EH representation for MSVC compatibility
Summary:
This introduces new instructions neccessary to implement MSVC-compatible
exception handling support.  Most of the middle-end and none of the
back-end haven't been audited or updated to take them into account.

Reviewers: rnk, JosephTremoulet, reames, nlewycky, rjmccall

Subscribers: llvm-commits

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

llvm-svn: 241888
2015-07-10 07:00:44 +00:00
Elena Demikhovsky
88c04dfc81 Extended syntax of vector version of getelementptr instruction.
The justification of this change is here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/082989.html

According to the current GEP syntax, vector GEP requires that each index must be a vector with the same number of elements.

%A = getelementptr i8, <4 x i8*> %ptrs, <4 x i64> %offsets

In this implementation I let each index be or vector or scalar. All vector indices must have the same number of elements. The scalar value will mean the splat vector value.

(1) %A = getelementptr i8, i8* %ptr, <4 x i64> %offsets
or
(2) %A = getelementptr i8, <4 x i8*> %ptrs, i64 %offset

In all cases the %A type is <4 x i8*>

In the case (2) we add the same offset to all pointers.

The case (1) covers C[B[i]] case, when we have the same base C and different offsets B[i].

The documentation is updated.

http://reviews.llvm.org/D10496

llvm-svn: 241788
2015-07-09 07:42:48 +00:00
James Y Knight
b7f40f93f9 Expand LangRef.html's documentation on LLVM's inline assembly.
While trying to figure out how this was all supposed to work, I
figured I'd start writing down some documentation, since it was
basically completely missing.

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

llvm-svn: 241698
2015-07-08 18:08:36 +00:00
Reid Kleckner
6207d850e4 [WinEH] Add localaddress intrinsic instead of using frameaddress
Clang uses this for SEH finally. The new intrinsic will produce the
right value when stack realignment is required.

llvm-svn: 241643
2015-07-07 23:23:03 +00:00
Reid Kleckner
45072b933e Rename llvm.frameescape and llvm.framerecover to localescape and localrecover
Summary:
Initially, these intrinsics seemed like part of a family of "frame"
related intrinsics, but now I think that's more confusing than helpful.
Initially, the LangRef specified that this would create a new kind of
allocation that would be allocated at a fixed offset from the frame
pointer (EBP/RBP). We ended up dropping that design, and leaving the
stack frame layout alone.

These intrinsics are really about sharing local stack allocations, not
frame pointers. I intend to go further and add an `llvm.localaddress()`
intrinsic that returns whatever register (EBP, ESI, ESP, RBX) is being
used to address locals, which should not be confused with the frame
pointer.

Naming suggestions at this point are welcome, I'm happy to re-run sed.

Reviewers: majnemer, nicholas

Subscribers: llvm-commits

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

llvm-svn: 241633
2015-07-07 22:25:32 +00:00
Charlie Turner
3bc933f220 [NFC] Minor editorial fixes to the CodeGen docs.
llvm-svn: 241249
2015-07-02 09:32:01 +00:00
Scott Douglass
a5d4043494 Expand Phabricator docs slightly
llvm-svn: 241161
2015-07-01 13:41:18 +00:00
JF Bastien
fb8500ea43 Getting started docs: https, and check signature
Summary: Download should be over https, not insecure ftp at least for the signature and key files. The signature should also get verified.

Test Plan: None

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 241138
2015-07-01 03:32:08 +00:00
Mark Heffernan
89eed2bb9e Fix several typos in LangRef.rst related to loop unrolling metadata.
llvm-svn: 241126
2015-06-30 22:48:51 +00:00
Sanjoy Das
d0dd6a0ba1 [FaultMaps] Let the frontend pre-select implicit null check candidates.
Summary:
This change introduces a !make.implicit metadata that allows the
frontend to pre-select the set of explicit null checks that will be
considered for transformation into implicit null checks.

The reason for not using profiling data instead of !make.implicit is
explained in the change to `FaultMaps.rst`.

Reviewers: atrick, reames, pgavlin, JosephTremoulet

Subscribers: llvm-commits

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

llvm-svn: 241116
2015-06-30 21:22:32 +00:00
Peter Collingbourne
48749b3316 COFF: Do not assign linker-weak symbols to selectany comdat sections.
It is mandatory to specify a comdat in order to receive comdat semantics
for a symbol. We were previously getting this wrong in -function-sections
mode; linker-weak symbols were being emitted in a selectany comdat. This
change causes such symbols to use a noduplicates comdat instead, fixing
the inconsistency.

Also correct an inaccuracy in the docs.

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

llvm-svn: 241103
2015-06-30 19:10:31 +00:00
Sanjoy Das
7226bf4ba4 [FaultMaps][Docs] Document the ImplicitNullChecks pass.
llvm-svn: 241009
2015-06-29 22:00:30 +00:00
Tom Stellard
ff6108f813 AMDGPU/SI: Update amd_kernel_code_t definition and add assembler support
Reviewers: arsenm

Subscribers: llvm-commits

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

llvm-svn: 240839
2015-06-26 21:58:31 +00:00
Tom Stellard
daced4c4cc AMDGPU/SI: Add hsa code object directives
Reviewers: arsenm

Subscribers: llvm-commits

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

llvm-svn: 240831
2015-06-26 21:15:07 +00:00
Alexey Samsonov
c200b66742 Make llvm-dwarfdump exit with non-zero exit code if error was occured.
llvm-svn: 240729
2015-06-25 23:40:15 +00:00
Justin Bogner
a5be37ef3b docs: Update allowed values for LLVM_USE_SANITIZER
"Thread" and combinations of "Address" and "Undefined" have been
accepted for a while now.

llvm-svn: 240316
2015-06-22 18:55:46 +00:00
Sanjoy Das
8777858a45 [NFC] Capitalization in documentation.
llvm-svn: 240303
2015-06-22 18:02:55 +00:00
Chandler Carruth
440d4e2329 [PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.
This will allow classes to implement the AA interface without deriving
from the class or referencing an internal enum of some other class as
their return types.

Also, to a pretty fundamental extent, concepts such as 'NoAlias',
'MayAlias', and 'MustAlias' are first class concepts in LLVM and we
aren't saving anything by scoping them heavily.

My mild preference would have been to use a scoped enum, but that
feature is essentially completely broken AFAICT. I'm extremely
disappointed. For example, we cannot through any reasonable[1] means
construct an enum class (or analog) which has scoped names but converts
to a boolean in order to test for the possibility of aliasing.

[1]: Richard Smith came up with a "solution", but it requires class
templates, and lots of boilerplate setting up the enumeration multiple
times. Something like Boost.PP could potentially bundle this up, but
even that would be quite painful and it doesn't seem realistically worth
it. The enum class solution would probably work without the need for
a bool conversion.

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

llvm-svn: 240255
2015-06-22 02:16:51 +00:00
Eric Christopher
0b2dfae3ba Fix "the the" in comments.
llvm-svn: 240112
2015-06-19 01:53:21 +00:00
David Majnemer
08bc5658f4 [docs] Fix "WARNING: Title underline too short."
llvm-svn: 239947
2015-06-17 21:21:16 +00:00
David Majnemer
c8b1f095a3 Move the personality function from LandingPadInst to Function
The personality routine currently lives in the LandingPadInst.

This isn't desirable because:
- All LandingPadInsts in the same function must have the same
  personality routine.  This means that each LandingPadInst beyond the
  first has an operand which produces no additional information.

- There is ongoing work to introduce EH IR constructs other than
  LandingPadInst.  Moving the personality routine off of any one
  particular Instruction and onto the parent function seems a lot better
  than have N different places a personality function can sneak onto an
  exceptional function.

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

llvm-svn: 239940
2015-06-17 20:52:32 +00:00
Peter Collingbourne
ea9bf98c05 Protection against stack-based memory corruption errors using SafeStack
This patch adds the safe stack instrumentation pass to LLVM, which separates
the program stack into a safe stack, which stores return addresses, register
spills, and local variables that are statically verified to be accessed
in a safe way, and the unsafe stack, which stores everything else. Such
separation makes it much harder for an attacker to corrupt objects on the
safe stack, including function pointers stored in spilled registers and
return addresses. You can find more information about the safe stack, as
well as other parts of or control-flow hijack protection technique in our
OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
and our project website (http://levee.epfl.ch).

The overhead of our implementation of the safe stack is very close to zero
(0.01% on the Phoronix benchmarks). This is lower than the overhead of
stack cookies, which are supported by LLVM and are commonly used today,
yet the security guarantees of the safe stack are strictly stronger than
stack cookies. In some cases, the safe stack improves performance due to
better cache locality.

Our current implementation of the safe stack is stable and robust, we
used it to recompile multiple projects on Linux including Chromium, and
we also recompiled the entire FreeBSD user-space system and more than 100
packages. We ran unit tests on the FreeBSD system and many of the packages
and observed no errors caused by the safe stack. The safe stack is also fully
binary compatible with non-instrumented code and can be applied to parts of
a program selectively.

This patch is our implementation of the safe stack on top of LLVM. The
patches make the following changes:

- Add the safestack function attribute, similar to the ssp, sspstrong and
  sspreq attributes.

- Add the SafeStack instrumentation pass that applies the safe stack to all
  functions that have the safestack attribute. This pass moves all unsafe local
  variables to the unsafe stack with a separate stack pointer, whereas all
  safe variables remain on the regular stack that is managed by LLVM as usual.

- Invoke the pass as the last stage before code generation (at the same time
  the existing cookie-based stack protector pass is invoked).

- Add unit tests for the safe stack.

Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.

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

llvm-svn: 239761
2015-06-15 21:07:11 +00:00
Sanjoy Das
48ec5dbb69 Unbreak docs build from r239740.
Add FaultMaps.rst to toctree.

llvm-svn: 239747
2015-06-15 19:38:15 +00:00
Sanjoy Das
a95063f8bb Unbreak the build from r239740.
Do not re-use an enum name as a field name.  Some bots don't like this.

llvm-svn: 239746
2015-06-15 19:29:44 +00:00
Sanjoy Das
b396b9e375 [CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.
Summary:
This instruction encodes a loading operation that may fault, and a label
to branch to if the load page-faults.  The locations of potentially
faulting loads and their "handler" destinations are recorded in a
FaultMap section, meant to be consumed by LLVM's clients.

Nothing generates FAULTING_LOAD_OP instructions yet, but they will be
used in a future change.

The documentation (FaultMaps.rst) needs improvement and I will update
this diff with a more expanded version shortly.

Depends on D10196

Reviewers: rnk, reames, AndyAyers, ab, atrick, pgavlin

Reviewed By: atrick, pgavlin

Subscribers: llvm-commits

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

llvm-svn: 239740
2015-06-15 18:44:08 +00:00
Tom Stellard
3f1708598e R600 -> AMDGPU rename
llvm-svn: 239657
2015-06-13 03:28:10 +00:00
Tom Stellard
2b78afe7cf R600/SI: Add assembler support for FLAT instructions
- Add glc, slc, and tfe operands to flat instructions
- Add missing flat instructions
- Fix the encoding of flat_load_dwordx3 and flat_store_dwordx3.

llvm-svn: 239637
2015-06-12 20:47:06 +00:00
Craig Topper
007d26c863 [TableGen] Correct the documentation for 'foreach' in the Language Intro.
llvm-svn: 239204
2015-06-06 00:44:42 +00:00
Sean Silva
e313985c55 [docs] Document "LGTM" in the lexicon.
llvm-svn: 239085
2015-06-04 20:28:09 +00:00
Filipe Cabecinhas
baed9bb3a1 [IR/AsmWriter] Output escape sequences if the first character isdigit()
If the first character in a metadata attachment's name is a digit, it has
to be output using an escape sequence, otherwise it's not valid text IR.

Removed an over-zealous assert from LLVMContext which didn't allow this.
The rule should only apply to text IR. Actual names can have any sequence
of non-NUL bytes.

Also added some documentation on accepted names.

Bug found with AFL fuzz.

llvm-svn: 238867
2015-06-02 21:25:08 +00:00
Jingyue Wu
5cf995662b [docs] fix the declarations of the llvm.nvvm.ptr.gen.to.* intrinsics
Summary:
These intrinsics should take a generic input address space and outputs a
non-generic address space.

Test Plan: no

Reviewers: jholewinski, eliben

Reviewed By: eliben

Subscribers: eliben, jholewinski, llvm-commits

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

llvm-svn: 238620
2015-05-29 22:18:03 +00:00
Frederic Riss
9f6be643e9 [YAMLIO] Make line-wrapping configurable and test it.
Summary:
We would wrap flow mappings and sequences when they go over a hardcoded 70
characters limit. Make the wrapping column configurable (and default to 70
co the change should be NFC for current users). Passing 0 allows to completely
suppress the wrapping which makes it easier to handle in tools like FileCheck.

Reviewers: bogner

Subscribers: llvm-commits

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

llvm-svn: 238584
2015-05-29 17:56:28 +00:00
Diego Novillo
8d1bae85a3 Update documentation for llvm-profdata.
These options have been present for a while, but I had never updated the
documentation. Fixed.

llvm-svn: 238511
2015-05-28 21:57:17 +00:00
Chandler Carruth
8c861ce28d Add some more detailed docs about the current state of Phabricator and
reviwes.llvm.org to help reduce confusion.

llvm-svn: 238295
2015-05-27 07:20:46 +00:00
Owen Anderson
1db6d7f8ed Add initial support for the convergent attribute.
llvm-svn: 238264
2015-05-26 23:48:40 +00:00
Kostya Serebryany
dd85a5b4fc [lib/Fuzzer] make the fuzzing timeout 1200 seconds by default (was: infinity)
llvm-svn: 238251
2015-05-26 20:57:47 +00:00
Kostya Serebryany
6903bb7921 [lib/Fuzzer] fix docs
llvm-svn: 238236
2015-05-26 19:32:52 +00:00
Kostya Serebryany
9638659852 [lib/Fuzzer] mention the user-supplied mutators
llvm-svn: 238062
2015-05-22 22:43:05 +00:00
Swaroop Sridhar
3aad0ef158 Document the CoreCLR GC Strategy
Add notead about the CoreCLR GC Strategy to the 
Garbage Collection document.

llvm-svn: 237869
2015-05-21 00:50:10 +00:00
Nick Kledzik
5aba866aed [doc] Update Lexicon with C++ unwinder acronyms
llvm-svn: 237840
2015-05-20 22:04:06 +00:00
Kostya Serebryany
dbee314d7f [lib/Fuzzer] more docs
llvm-svn: 237836
2015-05-20 21:03:03 +00:00
Sanjoy Das
4eaf966f48 Dereferenceable, dereferenceable_or_null metadata for loads
Summary:
Introduce dereferenceable, dereferenceable_or_null metadata for loads
with the same semantic as corresponding attributes.

This patch depends on http://reviews.llvm.org/D9253

Patch by Artur Pilipenko!

Reviewers: hfinkel, sanjoy, reames

Reviewed By: sanjoy, reames

Subscribers: llvm-commits

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

llvm-svn: 237720
2015-05-19 20:10:19 +00:00
Artyom Skrobov
6277c01b5a Fix documentation for Set-Like Containers
llvm-svn: 237677
2015-05-19 10:21:12 +00:00
Matthias Braun
f0934645e6 Doxygen: Enable autobrief feature and update coding standards.
llvm-svn: 237417
2015-05-15 03:34:01 +00:00
Justin Bogner
a0d6a70e7e docs: Fix up some .rst formatting
llvm-svn: 237409
2015-05-14 23:56:58 +00:00
Nick Lewycky
c31bb2286f Add a missing piece of existing practice to the developer policy. This may need further refinement, but I think is roughly correct.
llvm-svn: 237405
2015-05-14 23:21:33 +00:00
Alex Lorenz
ebb5069d3b YAML: Add support for literal block scalar I/O.
This commit gives the users of the YAML Traits I/O library 
the ability to serialize scalars using the YAML literal block 
scalar notation by allowing them to implement a specialization 
of the `BlockScalarTraits` struct for their custom types.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 237404
2015-05-14 23:08:22 +00:00
Michael Kuperstein
953a4ad86d Fixed some typos and broken links in source level debugging docs.
llvm-svn: 237357
2015-05-14 10:58:59 +00:00
Kostya Serebryany
b75a071f7a [lib/Fuzzer] update docs about test corpuses in git
llvm-svn: 237308
2015-05-13 22:42:28 +00:00
Sanjoy Das
cc4ee8fbd2 [Statepoints][Docs] Fix a couple of out of date examples.
Things I had missed in r237285.

llvm-svn: 237290
2015-05-13 20:20:10 +00:00
Sanjoy Das
ffc7dafe40 [Statepoints][Docs] Fix typo: change a period to a comma.
llvm-svn: 237289
2015-05-13 20:19:51 +00:00
Sanjoy Das
961d383020 [PlaceSafepoints] New attributes for patchable statepoints.
Summary:
This patch teaches the PlaceSafepoints pass about two `CallSite`
function attributes:

 * "statepoint-id": if the string value of this attribute can be parsed
   as an integer, then it is propagated to the ID parameter of the
   statepoint created.

 * "statepoint-num-patch-bytes": if the string value of this attribute
   can be parsed as an integer, then it is propagated to the `num patch
   bytes` parameter of the statepoint created.

This change intentionally does not assert on a malformed value for these
attributes, given that they're not "official" attributes.

Reviewers: reames, pgavlin

Subscribers: llvm-commits

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

llvm-svn: 237286
2015-05-13 20:11:31 +00:00
Sanjoy Das
58d34e616d [PlaceSafepoints] Update docs for r237214.
Show the two new ID and NumPatchBytes fields in the PlaceSafepoint
examples in Statepoints.rst to avoid confusion.

llvm-svn: 237285
2015-05-13 20:11:24 +00:00
Diego Novillo
6c03596a32 Add function entry count metadata.
Summary:
This adds three Function methods to handle function entry counts:
setEntryCount() and getEntryCount().

Entry counts are stored under the MD_prof metadata node with the name
"function_entry_count". They are unsigned 64 bit values set by profilers
(instrumentation and sample profiler changes coming up).

Added documentation for new profile metadata and tests.

Reviewers: dexonsmith, bogner

Subscribers: llvm-commits

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

llvm-svn: 237260
2015-05-13 15:13:45 +00:00
Sanjoy Das
6d67db8c09 [Statepoints] Support for "patchable" statepoints.
Summary:
This change adds two new parameters to the statepoint intrinsic, `i64 id`
and `i32 num_patch_bytes`.  `id` gets propagated to the ID field
in the generated StackMap section.  If the `num_patch_bytes` is
non-zero then the statepoint is lowered to `num_patch_bytes` bytes of
nops instead of a call (the spill and reload code remains unchanged).
A non-zero `num_patch_bytes` is useful in situations where a language
runtime requires complete control over how a call is lowered.

This change brings statepoints one step closer to patchpoints.  With
some additional work (that is not part of this patch) it should be
possible to get rid of `TargetOpcode::STATEPOINT` altogether.

PlaceSafepoints generates `statepoint` wrappers with `id` set to
`0xABCDEF00` (the old default value for the ID reported in the stackmap)
and `num_patch_bytes` set to `0`.  This can be made more sophisticated
later.

Reviewers: reames, pgavlin, swaroop.sridhar, AndyAyers

Subscribers: llvm-commits

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

llvm-svn: 237214
2015-05-12 23:52:24 +00:00
Pat Gavlin
f7cb0841d2 [Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT into two separate operands.
Differential Revision: http://reviews.llvm.org/D9623

llvm-svn: 237166
2015-05-12 19:50:19 +00:00
Kostya Serebryany
354905a212 [lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M is not. Update the docs.
llvm-svn: 237163
2015-05-12 18:51:57 +00:00
Adam Nemet
b894230e64 [Docs] Fix scoped noalias example
Summary:
As far as I understand the entire point of this example is to show that
if noalias is not a superset/equal to the alias.scope list on a scope
domain then load could reference locations that the store is not known
to not-alias i.e may alias.

Reviewers: hfinkel

Reviewed By: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 236977
2015-05-11 08:30:28 +00:00
Pat Gavlin
3f0887e69d Fix a docs build break introduced by rL236888.
llvm-svn: 236891
2015-05-08 18:37:49 +00:00
Pat Gavlin
c022b8d288 Extend the statepoint intrinsic to allow statepoints to be marked as transitions from GC-aware code to code that is not GC-aware.
This changes the shape of the statepoint intrinsic from:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 unused, ...call args, i32 # deopt args, ...deopt args, ...gc args)

to:

  @llvm.experimental.gc.statepoint(anyptr target, i32 # call args, i32 flags, ...call args, i32 # transition args, ...transition args, i32 # deopt args, ...deopt args, ...gc args)

This extension offers the backend the opportunity to insert (somewhat) arbitrary code to manage the transition from GC-aware code to code that is not GC-aware and back.

In order to support the injection of transition code, this extension wraps the STATEPOINT ISD node generated by the usual lowering lowering with two additional nodes: GC_TRANSITION_START and GC_TRANSITION_END. The transition arguments that were passed passed to the intrinsic (if any) are lowered and provided as operands to these nodes and may be used by the backend during code generation.

Eventually, the lowering of the GC_TRANSITION_{START,END} nodes should be informed by the GC strategy in use for the function containing the intrinsic call; for now, these nodes are instead replaced with no-ops.

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

llvm-svn: 236888
2015-05-08 18:07:42 +00:00
Alexey Samsonov
9792622ab9 Update CMake flags, LibFuzzer comments and docs for new -fsanitize-coverage= flags.
llvm-svn: 236797
2015-05-07 23:33:24 +00:00
Elena Demikhovsky
862079b386 Masked Gather and Scatter intrinsics - updated documentation.
llvm-svn: 236721
2015-05-07 12:25:11 +00:00
Kostya Serebryany
e33452df30 [lib/Fuzzer] rename TestOneInput to LLVMFuzzerTestOneInput to make it more unique
llvm-svn: 236652
2015-05-06 22:19:00 +00:00
Matthias Braun
47d7a6a19f Document some of the options in test/lit.cfg
llvm-svn: 236462
2015-05-04 21:37:00 +00:00
Matthias Braun
6cedce8963 Lit: Allow overriding llvm tool paths+arguments, make -D an alias for --param
These changes allow usages where you want to pass an additional
commandline option to all invocations of a specific llvm tool. Example:

> llvm-lit -Dllc=llc -enable-misched -verify-machineinstrs

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

llvm-svn: 236461
2015-05-04 21:36:36 +00:00
Alex Lorenz
92999a396f YAML: Add an optional 'flow' field to the mapping trait to allow flow mapping output.
This patch adds an optional 'flow' field to the MappingTrait
class so that yaml IO will be able to output flow mappings.

Reviewers: Justin Bogner

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

llvm-svn: 236456
2015-05-04 20:11:40 +00:00
Alex Lorenz
5814edb368 Update YamlIO documentation for the ScalarTraits class.
This patch adds the missing context parameter to the
input and output methods in ScalarTraits.

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

llvm-svn: 236328
2015-05-01 18:20:23 +00:00
Reid Kleckner
f16b28762e Add a note about permitting default member initializers
Use them in WinEHPrepare so that we can spot any toolchain bugs that
come up.

llvm-svn: 236244
2015-04-30 18:17:12 +00:00
Jonathan Roelofs
df8ac40381 Clean up docs references to './configure' in preparation for deprecating in-source builds
http://reviews.llvm.org/D8787

llvm-svn: 236144
2015-04-29 20:06:41 +00:00
Duncan P. N. Exon Smith
09b5c9c24d IR: Give 'DI' prefix to debug info metadata
Finish off PR23080 by renaming the debug info IR constructs from `MD*`
to `DI*`.  The last of the `DIDescriptor` classes were deleted in
r235356, and the last of the related typedefs removed in r235413, so
this has all baked for about a week.

Note: If you have out-of-tree code (like a frontend), I recommend that
you get everything compiling and tests passing with the *previous*
commit before updating to this one.  It'll be easier to keep track of
what code is using the `DIDescriptor` hierarchy and what you've already
updated, and I think you're extremely unlikely to insert bugs.  YMMV of
course.

Back to *this* commit: I did this using the rename-md-di-nodes.sh
upgrade script I've attached to PR23080 (both code and testcases) and
filtered through clang-format-diff.py.  I edited the tests for
test/Assembler/invalid-generic-debug-node-*.ll by hand since the columns
were off-by-three.  It should work on your out-of-tree testcases (and
code, if you've followed the advice in the previous paragraph).

Some of the tests are in badly named files now (e.g.,
test/Assembler/invalid-mdcompositetype-missing-tag.ll should be
'dicompositetype'); I'll come back and move the files in a follow-up
commit.

llvm-svn: 236120
2015-04-29 16:38:44 +00:00
Alexey Samsonov
18b3825dd6 [docs] Fix the link to SanitizerCoverage docs.
llvm-svn: 235934
2015-04-27 22:50:06 +00:00
Philip Reames
4b7adc613d [PerformanceTips] Italics are *word*, not _word_
llvm-svn: 235827
2015-04-26 22:25:29 +00:00
Philip Reames
1fcb602deb [PerformanceTips] Provide context on the impact of assume(x)
Sean Silva suggested I add something here a while back.  Sorry it's taken so long to get back to this.

llvm-svn: 235826
2015-04-26 22:23:12 +00:00
Philip Reames
f05e2c58e4 Add two new items to PerformanceTips
1) Turns out we're not great at recognizing redundant checks when one is a != and the other is an ==.  This is a bug, but it's one that matters to frontend authors.

2) Frontends shouldn't use intrinsics unless strictly neccessary.  This has been pretty widely proven by this point and is good to document.

llvm-svn: 235825
2015-04-26 22:15:18 +00:00
Bob Wilson
c58d816d5d Minor edits to the llvm-cov documentation.
This just changes a few places to use a slightly more formal style.

llvm-svn: 235389
2015-04-21 16:32:02 +00:00
Duncan P. N. Exon Smith
35fd651420 docs: Update Kaleidoscope for recent DI changes
This has been bit-rotting, so fix it up.  I'll have to edit this again
once the MD* classes have been renamed to DI* -- I'll try to remember to
do that with the commit that renames them.

llvm-svn: 235244
2015-04-18 00:01:35 +00:00
Sean Silva
ad3b0a3474 [LangRef] Remove redundant and inconsistent condition.
Just above, 'op2' is stated to be unsigned, so 'negative' doesn't make
sense (and is handled by "larger than" anyway). The descriptions for
lshr and ashr don't say 'negative or' either.

llvm-svn: 235230
2015-04-17 21:58:55 +00:00
Sanjoy Das
2d08e46e8b [IR] Introduce a dereferenceable_or_null(N) attribute.
Summary:
If a pointer is marked as dereferenceable_or_null(N), LLVM assumes it
is either `null` or `dereferenceable(N)` or both.  This change only
introduces the attribute and adds a token test case for the `llvm-as`
/ `llvm-dis`.  It does not hook up other parts of the optimizer to
actually exploit the attribute -- those changes will come later.

For pointers in address space 0, `dereferenceable(N)` is now exactly
equivalent to `dereferenceable_or_null(N)` && `nonnull`.  For other
address spaces, `dereferenceable(N)` is potentially weaker than
`dereferenceable_or_null(N)` && `nonnull` (since we could have a null
`dereferenceable(N)` pointer).

The motivating case for this change is Java (and other managed
languages), where pointers are either `null` or dereferenceable up to
some usually known-at-compile-time constant offset.

Reviewers: rafael, hfinkel

Reviewed By: hfinkel

Subscribers: nicholas, llvm-commits

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

llvm-svn: 235132
2015-04-16 20:29:50 +00:00
Charlie Turner
87d80515f9 Editorial changes in the programmers manual.
VMCore was renamed to IR back in 2013. The relevant "core"
implementations were moved into the lib/IR directory at the same time.

llvm-svn: 235116
2015-04-16 17:01:23 +00:00
Duncan P. N. Exon Smith
380b5bd2b0 DebugInfo: Remove 'inlinedAt:' field from MDLocalVariable
Remove 'inlinedAt:' from MDLocalVariable.  Besides saving some memory
(variables with it seem to be single largest `Metadata` contributer to
memory usage right now in -g -flto builds), this stops optimization and
backend passes from having to change local variables.

The 'inlinedAt:' field was used by the backend in two ways:

 1. To tell the backend whether and into what a variable was inlined.
 2. To create a unique id for each inlined variable.

Instead, rely on the 'inlinedAt:' field of the intrinsic's `!dbg`
attachment, and change the DWARF backend to use a typedef called
`InlinedVariable` which is `std::pair<MDLocalVariable*, MDLocation*>`.
This `DebugLoc` is already passed reliably through the backend (as
verified by r234021).

This commit removes the check from r234021, but I added a new check
(that will survive) in r235048, and changed the `DIBuilder` API in
r235041 to require a `!dbg` attachment whose 'scope:` is in the same
`MDSubprogram` as the variable's.

If this breaks your out-of-tree testcases, perhaps the script I used
(mdlocalvariable-drop-inlinedat.sh) will help; I'll attach it to PR22778
in a moment.

llvm-svn: 235050
2015-04-15 22:29:27 +00:00
Ed Maste
b8c5d92511 Correct 'teh' and other typos / repeated words.
Patch by Eitan Adler.

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

llvm-svn: 234939
2015-04-14 20:52:58 +00:00
David Blaikie
ce0784d591 [docs] Update outdated ExtendingLLVM.rst
Summary:
The document is still incomplete in some degrees, but updated to reflect the
latest changes. Anyway we can detail it if any one think it is not enough. For
the sake of it, some useful examples are listed below:

Refer to r113618 "Add X86 MMX type to bitcode and Type" for how to add a new
type.

> One notable change from then is only one thing that ``lib/VMCore`` is renamed
to ``lib/IR``.

Refer to r194760 "Add addrspacecast instruction" for how to add a new
instruction.

Patch by Chilledheart (rwindz0@gmail.com).

Reviewed By: echristo

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

llvm-svn: 234757
2015-04-13 16:04:17 +00:00
Kostya Serebryany
163cfd180d [lib/Fuzzer] Section: How good is my fuzzer?
llvm-svn: 234571
2015-04-10 06:32:29 +00:00
Kostya Serebryany
974cf7fe20 [lib/Fuzzer] explain compatibility with AFL
llvm-svn: 234570
2015-04-10 05:44:43 +00:00
Kostya Serebryany
daa2fc129a [lib/Fuzzer] show how to find Heartbleed with LibFuzzer
llvm-svn: 234391
2015-04-08 06:16:11 +00:00
Tom Stellard
a248c4bf52 R600/SI: Initial support for assembler and inline assembly
This is currently considered experimental, but most of the more
commonly used instructions should work.

So far only SI has been extensively tested, CI and VI probably work too,
but may be buggy.  The current set of tests cases do not give complete
coverage, but I think it is sufficient for an experimental assembler.

See the documentation in R600Usage for more information.

llvm-svn: 234381
2015-04-08 01:09:26 +00:00
Rafael Espindola
6fa49967ca Use a comma after the unique keyword.
H.J. Lu noted that all .section options are separated by a comma.

This patch changes the syntax of unique to require one.

llvm-svn: 234174
2015-04-06 16:34:41 +00:00
Rafael Espindola
0601e2fab8 Implement unique sections with an unique ID.
This allows the compiler/assembly programmer to switch back to a
section. This in turn fixes the bootstrap failure on powerpc (tested
on gcc110) without changing the ppc codegen at all.

I will try to cleanup the various getELFSection overloads in a  followup patch.
Just using a default argument now would lead to ambiguities.

llvm-svn: 234099
2015-04-04 18:02:01 +00:00
David Majnemer
694a466675 [WinEH] Sink UnwindHelp completely out of IR
We don't need to represent UnwindHelp in IR.  Instead, we can use the
knowledge that we are emitting the parent function to decide if we
should create the UnwindHelp stack object.

llvm-svn: 234061
2015-04-03 22:32:26 +00:00
Reid Kleckner
b08b580e85 [WinEH] Make llvm.eh.actions use frameescape indices for catch params
This makes it possible to use the same representation of llvm.eh.actions
in outlined handlers as we use in the parent function because i32's are
just constants that can be copied freely between functions.

I had to add a sentinel alloca to the list of child allocas so that we
don't try to sink the catch object into the handler. Normally, one would
use nullptr for this kind of thing, but TinyPtrVector doesn't support
null elements. More than that, it's elements have to have a suitable
alignment. Therefore, I settled on this for my sentinel:

  AllocaInst *getCatchObjectSentinel() {
    return static_cast<AllocaInst *>(nullptr) + 1;
  }

llvm-svn: 233947
2015-04-02 21:13:31 +00:00
Eli Bendersky
6b1c001175 Fix typo and reword in LangRef
Patch by Douglas Katzman

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

llvm-svn: 233920
2015-04-02 15:20:04 +00:00
Kostya Serebryany
af347bcc4a [fuzzer] document the -tokens flag. Also change the diagnostic output
llvm-svn: 233842
2015-04-01 21:33:20 +00:00
Sean Silva
73ea53f8e1 [docs] Fix typo.
Based on a patch by Stanislav Manilov!

llvm-svn: 233771
2015-03-31 22:48:45 +00:00
David Majnemer
e7ba02b466 [WinEH] Generate .xdata for catch handlers
This lets us catch exceptions in simple cases.

N.B. Things that do not work include (but are not limited to):
- Throwing from within a catch handler.
- Catching an object with a named catch parameter.
- 'CatchHigh' is fictitious, we aren't sure of its purpose.
- We aren't entirely efficient with regards to the number of EH states
  that we generate.
- IP-to-State tables are sensitive to the order of emission.

llvm-svn: 233767
2015-03-31 22:35:44 +00:00
Kostya Serebryany
90b97f867c [fuzzer] more documentation
llvm-svn: 233763
2015-03-31 21:39:38 +00:00
Scott Douglass
a6cf5f14db [docs] add cross-reference
llvm-svn: 233699
2015-03-31 15:07:53 +00:00
Kostya Serebryany
2fe2ed32ac Move lib/Fuzzer docs from a README.txt to a proper .rst file.
Summary:
Move lib/Fuzzer docs from a README.txt to a proper .rst file.
This change does not add any content, just formatting.

Test Plan: n/a

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 233638
2015-03-30 23:05:30 +00:00
Paul Robinson
87e7248c2e Explain how to abandon a review.
llvm-svn: 233600
2015-03-30 21:27:28 +00:00
Rafael Espindola
ee212d8868 Fix Sphinx warning " Title underline too short.".
llvm-svn: 233551
2015-03-30 15:16:30 +00:00
David Majnemer
74b5efbe6b WinEH: Create a parent frame alloca for HandlerType xdata tables
We don't have any logic to emit those tables yet, so the SDAG lowering
of this intrinsic is just a stub.  We can see the intrinsic in the
prepared IR, though.

llvm-svn: 233354
2015-03-27 04:17:07 +00:00
Sanjoy Das
d429dd288c [ADT][CMake][AutoConf] Fail-fast iterators for DenseMap
Summary:
This patch is an attempt at making `DenseMapIterator`s "fail-fast".
Fail-fast iterators that have been invalidated due to insertion into
the host `DenseMap` deterministically trip an assert (in debug mode)
on access, instead of non-deterministically hitting memory corruption
issues.

Enabling fail-fast iterators breaks the LLVM C++ ABI, so they are
predicated on `LLVM_ENABLE_ABI_BREAKING_CHECKS`.
`LLVM_ENABLE_ABI_BREAKING_CHECKS` by default flips with
`LLVM_ENABLE_ASSERTS`, but can be clamped to ON or OFF using the CMake /
autoconf build system.

Reviewers: chandlerc, dexonsmith, rnk, zturner

Subscribers: llvm-commits

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

llvm-svn: 233310
2015-03-26 19:25:01 +00:00
Reid Kleckner
a894d59f4a WinEH: Create an unwind help alloca for __CxxFrameHandler3 xdata tables
We don't have any logic to emit those tables yet, so the sdag lowering
of this intrinsic is just a stub. We can see the intrinsic in the
prepared IR, though.

llvm-svn: 233209
2015-03-25 20:10:36 +00:00
Justin Bogner
b8431e70e2 docs: Update llvm-cov docs for the -use-color flag
llvm-svn: 232742
2015-03-19 18:22:46 +00:00
Mehdi Amini
953d88aa5d Update 3.7 Release Note mentionning the non-optionality of the DataLayout
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 232677
2015-03-18 22:01:44 +00:00
Duncan P. N. Exon Smith
38d7ba8c83 docs: Update LangRef and SourceLevelDebugging
Cleanup some bitrot in SourceLevelDebugging.rst.

  - Pull the still-relevant details about individual descriptors into
    LangRef.rst.  Cut a lot of it to avoid over-describing the fields,
    as the C++ classes and assembly format are mostly self-describing
    now.  If there's anything specific that I shouldn't have cut, let me
    know and I'll add it back.
  - Rewrite the remaining sections to refer to the new debug info
    hierarchy in LangRef.rst.

llvm-svn: 232566
2015-03-17 23:41:05 +00:00
Sean Silva
506c35deff [docs] Fix some malformed links.
Patch by Stanislav Manilov!

llvm-svn: 232546
2015-03-17 21:02:37 +00:00
Adam Nemet
9a119a2574 [docs] Fix copy-and-paste bug in def-use example
This appeared when the example was converted to use range-based loop in
r207755.

llvm-svn: 232509
2015-03-17 17:51:58 +00:00
Renato Golin
6533f82835 Adding commit msg guidelines to dev policy
After much bike shed discussions, we seem to agree to a few loose
but relevant guidelines on how to prepare a commit message. It also
points the attribution section to the new commit messages section
to deduplicate information.

llvm-svn: 232334
2015-03-15 21:15:48 +00:00
Mehdi Amini
9ad11af6f1 Update LangRef now that a DataLayout is mandatory.
Reviewers: rafael, echristo

Reviewed By: rafael

Subscribers: rafael, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 232283
2015-03-14 22:04:06 +00:00
Chris Bieneman
8f7b69cfb8 A few minor updates based on feedback from Justin and a few things I thought were missing.
* Moved autotools configure & build example out of "Getting Started Quickly (A Summary)" and into BuildingLLVMWithAutoTools.
* Removed the annotations that CMake is the recommended process and Autotools is alternate.
* Added brief documentation about build targets under "Getting Started Quickly..."
* Added Overview text to BuildingLLVMWithAutotools
* Fixed up a broken link.

llvm-svn: 232278
2015-03-14 21:20:32 +00:00
David Blaikie
3ea2df7c7b [opaque pointer type] Add textual IR support for explicit type parameter to gep operator
Similar to gep (r230786) and load (r230794) changes.

Similar migration script can be used to update test cases, which
successfully migrated all of LLVM and Polly, but about 4 test cases
needed manually changes in Clang.

(this script will read the contents of stdin and massage it into stdout
- wrap it in the 'apply.sh' script shown in previous commits + xargs to
apply it over a large set of test cases)

import fileinput
import sys
import re

rep = re.compile(r"(getelementptr(?:\s+inbounds)?\s*\()((<\d*\s+x\s+)?([^@]*?)(|\s*addrspace\(\d+\))\s*\*(?(3)>)\s*)(?=$|%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|zeroinitializer|<|\[\[[a-zA-Z]|\{\{)", re.MULTILINE | re.DOTALL)

def conv(match):
  line = match.group(1)
  line += match.group(4)
  line += ", "
  line += match.group(2)
  return line

line = sys.stdin.read()
off = 0
for match in re.finditer(rep, line):
  sys.stdout.write(line[off:match.start()])
  sys.stdout.write(conv(match))
  off = match.end()
sys.stdout.write(line[off:])

llvm-svn: 232184
2015-03-13 18:20:45 +00:00
Chris Bieneman
2fd3a11a4e Updating GettingStarted documentation to reference CMake as the preferred way to build LLVM.
Reviewers: chandlerc, samsonov, echristo

Reviewed By: samsonov

Subscribers: emaste, joker.eph, llvm-commits

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

llvm-svn: 232135
2015-03-13 01:58:14 +00:00
Logan Chien
5ce6985607 [docs] Update the doxygen configuration file.
Update the doxygen configuration file and Makefile build rules
to provide better output (simply use the default stylesheet and template
from the Doxygen distribution.)

This CL has upgrade doxygen.cfg.in to Doxygen 1.8.6.

llvm-svn: 232064
2015-03-12 17:26:27 +00:00
Logan Chien
e9375e4aec [autoconf] Refine doxygen document options.
This CL adds --enable-doxygen-search to enable doxygen search engine
and --enable-doxygen-qt-help to enable the Qt help file generation.

llvm-svn: 232062
2015-03-12 17:25:01 +00:00
Justin Bogner
3f587b0b1d docs: Fix a typo in my previous commit
llvm-svn: 232009
2015-03-12 04:43:01 +00:00
Justin Bogner
676913c46b docs: Document the llvm-cov show and report commands
Add a basic synopsis of how to work with instrprof based coverage
using the llvm-cov tools.

llvm-svn: 232007
2015-03-12 04:18:21 +00:00
Reid Kleckner
ae151db0a9 Make llvm.eh.actions an intrinsic and add docs for it
These docs *don't* match the way WinEHPrepare uses them yet, and
verifier support isn't implemented either. The implementation will come
after the documentation text is reviewed and agreed upon.

llvm-svn: 232003
2015-03-12 01:45:37 +00:00
Justin Bogner
a916a3a744 docs: Try to fix a couple of internal links in the llvm-profdata manual
These links seem broken on llvm.org/docs. Change them to use the
sphinx-recommended style to see if that helps.

llvm-svn: 232001
2015-03-12 01:38:50 +00:00
Dan Liew
88e5a0fd0d Fix too short title underline reported by build-bot.
llvm-svn: 231921
2015-03-11 13:34:49 +00:00
Chandler Carruth
1305553a21 Inspired by r231891, use gender neutral pronouns in the places I've
found in LLVM.

llvm-svn: 231893
2015-03-11 00:15:44 +00:00
Kevin Qin
0f6643694d Introduce runtime unrolling disable matadata and use it to mark the scalar loop from vectorization.
Runtime unrolling is an expensive optimization which can bring benefit
only if the loop is hot and iteration number is relatively large enough.
For some loops, we know they are not worth to be runtime unrolled.
The scalar loop from vectorization is one of the cases.

llvm-svn: 231631
2015-03-09 06:14:18 +00:00
Benjamin Kramer
11906dabef CodingStyle: Allow delegating ctors
Delegating constructors seem to work fine with all supported compilers.

llvm-svn: 231473
2015-03-06 13:46:50 +00:00
Paul Robinson
1fde157419 All FileCheck directives allow patterns.
llvm-svn: 231418
2015-03-05 23:04:26 +00:00
Reid Kleckner
d0e0d012a0 Replace llvm.frameallocate with llvm.frameescape
Turns out it's pretty straightforward and simplifies the implementation.

Reviewers: andrew.w.kaylor

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

llvm-svn: 231386
2015-03-05 18:26:34 +00:00
Duncan P. N. Exon Smith
89cacfd677 FileCheck: Document CHECK-SAME, follow-up to r230612
llvm-svn: 231379
2015-03-05 17:00:05 +00:00
Philip Reames
7b15cce9dd Add a few more performance tips
These came from my own experience and may not apply equally to all use cases.  Any alternate perspective anyone has should be used to refine these.  

As always, grammar and spelling adjustments are more than welcome.  Please just directly commit a fix if you see something problematic.

llvm-svn: 231352
2015-03-05 05:55:55 +00:00
Philip Reames
3827737593 Add a link to the new PerformanceTips docs from the 3.7 release notes
llvm-svn: 231349
2015-03-05 05:11:05 +00:00
Aaron Ballman
d0d3ba7199 Initializer lists are supported in MSVC 2013. Since that's our minimum required version, we can move that to the list of acceptable C++11 features.
llvm-svn: 231313
2015-03-04 23:17:31 +00:00
David Blaikie
182f36a210 Update LangRef for explicit type changes to 'load' instruction
llvm-svn: 231296
2015-03-04 22:06:14 +00:00
David Blaikie
02777f64c8 Update LangRef for getelementptr explicit type changes
Here's a rough/first draft - it at least hits the actual textual IR
examples and some of the phrasing. It's probably worth a full pass over,
but I'm not sure how much these docs should reflect the strange
intermediate state we're in anyway.

Totally open to lots of review/feedback/suggestions.

llvm-svn: 231294
2015-03-04 22:02:58 +00:00
Reid Kleckner
6e4477efc1 Document the LLVM "thunk" attribute added back in r226708
llvm-svn: 231181
2015-03-04 00:08:56 +00:00
David Majnemer
afec5083b2 LangRef: Clarify select's semantics with vector arguments
llvm-svn: 231158
2015-03-03 22:45:47 +00:00
Reid Kleckner
34a636c32a Make llvm.eh.begincatch use an outparam
Ultimately, __CxxFrameHandler3 needs us to put a stack offset in a
table, and it will take responsibility for copying the exception object
into that slot. Modelling the exception object as an SSA value returned
by begincatch isn't going to work in general, so make it use an output
parameter.

Reviewers: andrew.w.kaylor

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

llvm-svn: 231086
2015-03-03 17:41:09 +00:00
Duncan P. N. Exon Smith
8d1b74869c DebugInfo: Move new hierarchy into place
Move the specialized metadata nodes for the new debug info hierarchy
into place, finishing off PR22464.  I've done bootstraps (and all that)
and I'm confident this commit is NFC as far as DWARF output is
concerned.  Let me know if I'm wrong :).

The code changes are fairly mechanical:

  - Bumped the "Debug Info Version".
  - `DIBuilder` now creates the appropriate subclass of `MDNode`.
  - Subclasses of DIDescriptor now expect to hold their "MD"
    counterparts (e.g., `DIBasicType` expects `MDBasicType`).
  - Deleted a ton of dead code in `AsmWriter.cpp` and `DebugInfo.cpp`
    for printing comments.
  - Big update to LangRef to describe the nodes in the new hierarchy.
    Feel free to make it better.

Testcase changes are enormous.  There's an accompanying clang commit on
its way.

If you have out-of-tree debug info testcases, I just broke your build.

  - `upgrade-specialized-nodes.sh` is attached to PR22564.  I used it to
    update all the IR testcases.
  - Unfortunately I failed to find way to script the updates to CHECK
    lines, so I updated all of these by hand.  This was fairly painful,
    since the old CHECKs are difficult to reason about.  That's one of
    the benefits of the new hierarchy.

This work isn't quite finished, BTW.  The `DIDescriptor` subclasses are
almost empty wrappers, but not quite: they still have loose casting
checks (see the `RETURN_FROM_RAW()` macro).  Once they're completely
gutted, I'll rename the "MD" classes to "DI" and kill the wrappers.  I
also expect to make a few schema changes now that it's easier to reason
about everything.

llvm-svn: 231082
2015-03-03 17:24:31 +00:00
Philip Reames
df4e6f1751 [PerformanceTips] Document various items folks have suggested
This could stand to be expanded - patches welcome! - but let's at least write them down so they don't get forgotten.

llvm-svn: 230995
2015-03-02 19:19:04 +00:00
Peter Zotov
813b6bbde6 [OCaml] Generate documentation again with autoconf buildsystem.
Patch by Evangelos Foutras:

r220899 started using ocamlfind to build the OCaml bindings but
docs/Makefile still contains references to the OCAMLDOC macro which
is no longer being defined. The result is that OCaml documentation
isn't generated/installed.

llvm-svn: 230850
2015-02-28 13:48:23 +00:00
Philip Reames
b5c64a23b3 [new docs] Performance Tips for Frontend Authors
As mentioned on llvm-dev, this is a new documentation page intended to collect tips for frontend authors on how to generate IR that LLVM is able to optimize well. These types of things come up repeated in review threads and it would be good to have a place to save them.

I added a small handful to start us off, but I mostly want to get the framework in place. Once the docs are here, we can add to them incrementally.  If you know of something appropriate for this page, please add it!

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

llvm-svn: 230807
2015-02-27 23:14:50 +00:00
Benjamin Kramer
6333fd2b12 Refer users looking for the release notes to 3.6.
llvm-svn: 230781
2015-02-27 19:06:26 +00:00
Reid Kleckner
27f79d7986 Delete LLVM_DELETED_FUNCTION from coding standards
It didn't seem worth leaving behind a guideline to use '= delete' to
make a class uncopyable. That's a well known C++ design pattern.

Reported on the mailing list and in PR22724.

llvm-svn: 230776
2015-02-27 18:34:16 +00:00
Nico Weber
3b39196dab Try to fix a docs link.
llvm-svn: 230672
2015-02-26 19:48:43 +00:00
Philip Reames
e0b4be5549 [GC docs] Add example IR, assembly, and stackmaps to Statepoint documentation
When I originally committed the statepoint docs, I left placeholders for example IR fragments.  I'm finally getting around to filling those in.  

I also added IR fragments to illustrate the usage of the PlaceSafepoints pass while I was at it.

llvm-svn: 230601
2015-02-26 01:18:21 +00:00
Philip Reames
59671891b6 [GC docs] More minor word tweaks to make the GC bits clearer
llvm-svn: 230581
2015-02-25 23:52:06 +00:00
Philip Reames
32bece890d [GC Docs] Update LangRef to link to Statepoint docs
Add a brief section linking to the experimental statepoint intrinsics analogous to the one we have linking to patchpoint.  

While I'm here, cleanup some wording about what the gc "name" attribute actually means.  It's not the name of a *collector* it's the name of the *strategy* which may be compatible with multiple collectors.

llvm-svn: 230576
2015-02-25 23:45:20 +00:00
Philip Reames
7cf1817c95 [GC docs] Fill in description of the statepoint-example GC strategy
llvm-svn: 230572
2015-02-25 23:22:43 +00:00
Philip Reames
e56df96485 [GC Docs] Minor wording clarification
llvm-svn: 230570
2015-02-25 23:07:34 +00:00
Chris Lattner
21feff6ab2 fix a typo
llvm-svn: 230510
2015-02-25 17:28:41 +00:00
Philip Reames
b509c48283 [GC] Document the recently added PlaceSafepoints and RewriteGCForStatepoints passes
llvm-svn: 230420
2015-02-25 01:23:59 +00:00
Philip Reames
0f7f6f7f17 Fix consistently wrong sphinx markup
I'd been using '' where I should have been using ``.

llvm-svn: 230407
2015-02-25 00:22:07 +00:00
Philip Reames
3a07521b21 Update the GC docs to explicitly mention both gcroot and gc.statepoint
Also, fix confusing bit of the gcroot documentation that bit me personally.

llvm-svn: 230405
2015-02-25 00:18:04 +00:00
Philip Reames
6468a5f251 [GC] Sync documentation with code naming
Fixing an issue pointed out by Sean Silva.  Thanks!

llvm-svn: 230403
2015-02-24 23:57:26 +00:00
Philip Reames
4d5446e399 More GC documentation cleanup
llvm-svn: 230402
2015-02-24 23:51:37 +00:00
Philip Reames
52791a374e More GC doc cleanup
Mostly minor wording changes for readability.  Nothing major to see here.

llvm-svn: 230397
2015-02-24 23:34:24 +00:00
Peter Collingbourne
b005cb0cfc LowerBitSets: Introduce global layout builder.
The builder is based on a layout algorithm that tries to keep members of
small bit sets together. The new layout compresses Chromium's bit sets to
around 15% of their original size.

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

llvm-svn: 230394
2015-02-24 23:17:02 +00:00
Philip Reames
135d984527 Improve the getting started instructions in the GC docs
This is still gcroot vs gc.statepoint agnostic.  I'm just trying to clarify the general documentation at this point.

llvm-svn: 230393
2015-02-24 23:12:27 +00:00
Hans Wennborg
35a376e970 ReleaseNotes: add notes about VS2014 Update 4 requirement
llvm-svn: 230363
2015-02-24 20:36:40 +00:00
Arch D. Robison
8ca1c4da63 Fix typo: qual -> equal
llvm-svn: 230361
2015-02-24 20:11:49 +00:00
Philip Reames
f2814925a2 Starting to cleanup the garbage collection documentation
In this change:
- Put the getting started section first
- Create a dedicated section to document the built in collector strategies
- Move discuss of ShadowStack into new section
- Add placeholders for erlang, ocaml, and statepoint-example collectors

There will be many more changes following.  I plan on full integrating the documentation for gc.statepoint and gc.root.  I want to make it much clearer on how to get started and what users should expect in terms of effort.

llvm-svn: 230359
2015-02-24 19:44:46 +00:00
Nico Weber
c712fac3f6 Try to fix reST markup for an external link.
llvm-svn: 230200
2015-02-23 03:31:29 +00:00
Justin Bogner
29a9e0dab9 docs: Mention that assertions must be enabled to use the -stats flag
Patch by Rob Stewart. Thanks!

llvm-svn: 230144
2015-02-21 20:53:36 +00:00
Peter Collingbourne
68aaa34960 Introduce bitset metadata format and bitset lowering pass.
This patch introduces a new mechanism that allows IR modules to co-operatively
build pointer sets corresponding to addresses within a given set of
globals. One particular use case for this is to allow a C++ program to
efficiently verify (at each call site) that a vtable pointer is in the set
of valid vtable pointers for the class or its derived classes. One way of
doing this is for a toolchain component to build, for each class, a bit set
that maps to the memory region allocated for the vtables, such that each 1
bit in the bit set maps to a valid vtable for that class, and lay out the
vtables next to each other, to minimize the total size of the bit sets.

The patch introduces a metadata format for representing pointer sets, an
'@llvm.bitset.test' intrinsic and an LTO lowering pass that lays out the globals
and builds the bitsets, and documents the new feature.

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

llvm-svn: 230054
2015-02-20 20:30:47 +00:00
Eric Christopher
d1c4eedddb Fix grammar in documentation.
Patch by Ralph Campbell!

llvm-svn: 229884
2015-02-19 18:46:25 +00:00
Benjamin Kramer
a78f8364ea Document that defaulted & deleted methods and explicit conversions are allowed now.
llvm-svn: 229369
2015-02-16 10:28:41 +00:00
Benjamin Kramer
c1b3bb4e32 Remove LLVM_HAS_VARIADIC_TEMPLATES and all the faux variadic workarounds guarded by it.
We no longer support compilers without variadic template support.

llvm-svn: 229324
2015-02-15 19:34:28 +00:00
Benjamin Kramer
4579422ac9 Update the docs to require at least MSVC 2013.
llvm-svn: 229323
2015-02-15 19:34:17 +00:00
Tom Stellard
e484e6e977 Help: Document how to build and install with CMake.
Resolves PR21569.

Patch by: Stephen Kelly

llvm-svn: 229122
2015-02-13 16:15:32 +00:00
Tom Stellard
0ce41db454 Help: Document the minimum CMake version required.
Patch by: Stephen Kelly

llvm-svn: 229121
2015-02-13 16:15:29 +00:00
Reid Kleckner
86643b627c Don't promote asynch EH invokes of nounwind functions to calls
If the landingpad of the invoke is using a personality function that
catches asynch exceptions, then it can catch a trap.

Also add some landingpads to invalid LLVM IR test cases that lack them.

Over-the-shoulder reviewed by David Majnemer.

llvm-svn: 228782
2015-02-11 01:23:16 +00:00
Nico Weber
3c9f2a746e fix docs typo
llvm-svn: 228741
2015-02-10 20:43:54 +00:00
Andrew Kaylor
fff974fc6d Adding support for llvm.eh.begincatch and llvm.eh.endcatch intrinsics and beginning the documentation of native Windows exception handling.
Differential Revision: http://reviews.llvm.org/D7398

llvm-svn: 228733
2015-02-10 19:52:43 +00:00
Renato Golin
a82e770335 Fix typo in cmake example docs
Patch by Vinicius Tinti.

llvm-svn: 228690
2015-02-10 14:15:58 +00:00
Mehdi Amini
43980fc56a [DOC] Asserts are only enabled in Debug build, update the doc accordingly
Summary:
The CMake configuration is explicitely looking for Debug build, all the
other variant disable assertions.

Subscribers: llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 228653
2015-02-10 02:04:29 +00:00
Duncan P. N. Exon Smith
95f6ff35e1 DebugInfo: Remove DW_TAG_constant
Remove handling for DW_TAG_constant.  We started producing it in
r110656, but reverted that in r110876 without dropping the support.
Finish the job.

llvm-svn: 228623
2015-02-09 22:48:04 +00:00
David Blaikie
7042f50113 Rename the 'Extending the Language: Debug Information' to 'Adding Debug Information' since this isn't actually modifying/extending the language.
llvm-svn: 228512
2015-02-07 23:23:43 +00:00
Jonathan Roelofs
40c3cf941d Fix docs typo regarding lit.local.cfg files
llvm-svn: 228499
2015-02-07 17:18:26 +00:00
Sean Silva
d2940e0dbb [docs][LLVM-style RTTI] Add a mention of multiple inheritance.
llvm-svn: 228479
2015-02-07 01:16:26 +00:00
Sean Silva
f0d42da25b [docs] Put an explicit link to InAlloca.rst
llvm-svn: 228192
2015-02-04 20:51:19 +00:00
Peter Collingbourne
02d122cad4 Misc documentation/comment fixes.
llvm-svn: 228093
2015-02-04 00:42:45 +00:00
Yunzhong Gao
be4f49d2b3 Remove the preverify pass from the documentation now that it has been removed
since r199487.

llvm-svn: 227608
2015-01-30 20:51:09 +00:00
Philip Reames
3fb0b7b5e7 Remove gc.root's performCustomLowering
This is a refactoring to restructure the single user of performCustomLowering as a specific lowering pass and remove the custom lowering hook entirely.

Before this change, the LowerIntrinsics pass (note to self: rename!) was essentially acting as a pass manager, but without being structured in terms of passes. Instead, it proxied calls to a set of GCStrategies internally. This adds a lot of conceptual complexity (i.e. GCStrategies are stateful!) for very little benefit. Since there's been interest in keeping the ShadowStackGC working, I extracting it's custom lowering pass into a dedicated pass and just added that to the pass order. It will only run for functions which opt-in to that gc.

I wasn't able to find an easy way to preserve the runtime registration of custom lowering functionality. Given that no user of this exists that I'm aware of, I made the choice to just remove that. If someone really cares, we can look at restoring it via dynamic pass registration in the future.

Note that despite the large diff, none of the lowering code actual changes. I added the framing needed to make it a pass and rename the class, but that's it.

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

llvm-svn: 227351
2015-01-28 19:28:03 +00:00
Sean Silva
169a4f208a [docs] Use slightly more proper .rst markup
Again, I'd like to emphasize to everyone that this sort of markup change
is *not* what you should be concerned about when writing docs. Focus on
*content*.

I applaud Chandler for focusing on the fantastic content of this new
section!

llvm-svn: 227305
2015-01-28 10:36:41 +00:00
Sean Silva
f7550e6c32 [docs] [cleanup] No need for a comment around C++11 override
llvm-svn: 227304
2015-01-28 10:26:29 +00:00
Chandler Carruth
27602132b1 Introduce a section to the programmers manual about type hierarchies,
polymorphism, and virtual dispatch.

This is essentially trying to explain the emerging design techniques
being used in LLVM these days somewhere more accessible than the
comments on a particular piece of infrastructure. It covers the
"concepts-based polymorphism" that caused some confusion during initial
reviews of the new pass manager as well as the tagged-dispatch mechanism
used pervasively in LLVM and Clang.

Perhaps most notably, I've tried to provide some criteria to help
developers choose between these options when designing new pieces of
infrastructure.

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

llvm-svn: 227292
2015-01-28 03:04:54 +00:00
Simon Atanasyan
9e62a55755 [docs] Add link to the MIPS 64-bit ELF object file specification
llvm-svn: 227050
2015-01-25 16:20:30 +00:00
Charlie Turner
dd36479c15 Fixup debug information references.
llvm-svn: 227020
2015-01-24 21:51:21 +00:00
Charlie Turner
2496f97c24 Update references to lines of code count.
The number of lines of code in Kaleidoscope has risen from the
previously reported 700 to 986 according to the cloc tool. This tools
was run on the toy.cpp file from Chapter 8.

llvm-svn: 227019
2015-01-24 21:51:17 +00:00
Ramkumar Ramachandra
550e92d3f7 Intrinsics: introduce llvm_any_ty aka ValueType Any
Specifically, gc.result benefits from this greatly. Instead of:

gc.result.int.*
gc.result.float.*
gc.result.ptr.*
...

We now have a gc.result.* that can specialize to literally any type.

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

llvm-svn: 226857
2015-01-22 20:14:38 +00:00
Paul Robinson
4e123e1b82 Explicitly describe '///' versus '//' comment delimiters.
llvm-svn: 226750
2015-01-22 00:19:56 +00:00
Chandler Carruth
c47432114d [PM] Split the LoopInfo object apart from the legacy pass, creating
a LoopInfoWrapperPass to wire the object up to the legacy pass manager.

This switches all the clients of LoopInfo over and paves the way to port
LoopInfo to the new pass manager. No functionality change is intended
with this iteration.

llvm-svn: 226373
2015-01-17 14:16:18 +00:00
Hans Wennborg
95fbe0c01e ProgrammersManual.rst: fix a typo
llvm-svn: 226367
2015-01-17 03:19:21 +00:00
Hal Finkel
04316a019c [PowerPC] Adjust PatchPoints for ppc64le
Bill Schmidt pointed out that some adjustments would be needed to properly
support powerpc64le (using the ELF V2 ABI). For one thing, R11 is not available
as a scratch register, so we need to use R12. R12 is also available under ELF
V1, so to maintain consistency, I flipped the order to make R12 the first
scratch register in the array under both ABIs.

llvm-svn: 226247
2015-01-16 04:40:58 +00:00
Hans Wennborg
9eab633d6d ReleaseNotes.rst: bump version to 3.7
The 3.6 notes are now in the 3.6 branch.

llvm-svn: 226007
2015-01-14 18:07:30 +00:00
Hans Wennborg
1e3cdfce8e Trunk is now 3.7.0svn
llvm-svn: 226004
2015-01-14 17:38:03 +00:00
Sanjay Patel
42ec4aebe9 fix typos
llvm-svn: 225991
2015-01-14 16:03:58 +00:00
Mehdi Amini
54e3de76f7 SelectionDAG: add a -filter-view-dags option to llc
This option takes the name of the basic block you want to visualize
with -view-*-dags

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

llvm-svn: 225953
2015-01-14 06:03:18 +00:00
Hal Finkel
a11b7ea471 Revert "r225811 - Revert "r225808 - [PowerPC] Add StackMap/PatchPoint support""
This re-applies r225808, fixed to avoid problems with SDAG dependencies along
with the preceding fix to ScheduleDAGSDNodes::RegDefIter::InitNodeNumDefs.
These problems caused the original regression tests to assert/segfault on many
(but not all) systems.

Original commit message:

This commit does two things:

 1. Refactors PPCFastISel to use more of the common infrastructure for call
    lowering (this lets us take advantage of this common code for lowering some
    common intrinsics, stackmap/patchpoint among them).

 2. Adds support for stackmap/patchpoint lowering. For the most part, this is
    very similar to the support in the AArch64 target, with the obvious differences
    (different registers, NOP instructions, etc.). The test cases are adapted
    from the AArch64 test cases.

One difference of note is that the patchpoint call sequence takes 24 bytes, so
you can't use less than that (on AArch64 you can go down to 16). Also, as noted
in the docs, we take the patchpoint address to be the actual code address
(assuming the call is local in the TOC-sharing sense), which should yield
higher performance than generating the full cross-DSO indirect-call sequence
and is likely just as useful for JITed code (if not, we'll change it).

StackMaps and Patchpoints are still marked as experimental, and so this support
is doubly experimental. So go ahead and experiment!

llvm-svn: 225909
2015-01-14 01:07:51 +00:00
Duncan P. N. Exon Smith
85eaac222d AsmParser/Bitcode: Add support for MDLocation
This adds assembly and bitcode support for `MDLocation`.  The assembly
side is rather big, since this is the first `MDNode` subclass (that
isn't `MDTuple`).  Part of PR21433.

(If you're wondering where the mountains of testcase updates are, we
don't need them until I update `DILocation` and `DebugLoc` to actually
use this class.)

llvm-svn: 225830
2015-01-13 21:10:44 +00:00
Peter Collingbourne
4b966fed4c Add link to Go bindings documentation.
llvm-svn: 225815
2015-01-13 18:49:42 +00:00
Hal Finkel
c6fdfe466f Revert "r225808 - [PowerPC] Add StackMap/PatchPoint support"
Reverting this while I investiage buildbot failures (segfaulting in
GetCostForDef at ScheduleDAGRRList.cpp:314).

llvm-svn: 225811
2015-01-13 18:25:05 +00:00
Hal Finkel
ed17decbc6 [PowerPC] Add StackMap/PatchPoint support
This commit does two things:

 1. Refactors PPCFastISel to use more of the common infrastructure for call
    lowering (this lets us take advantage of this common code for lowering some
    common intrinsics, stackmap/patchpoint among them).

 2. Adds support for stackmap/patchpoint lowering. For the most part, this is
    very similar to the support in the AArch64 target, with the obvious differences
    (different registers, NOP instructions, etc.). The test cases are adapted
    from the AArch64 test cases.

One difference of note is that the patchpoint call sequence takes 24 bytes, so
you can't use less than that (on AArch64 you can go down to 16). Also, as noted
in the docs, we take the patchpoint address to be the actual code address
(assuming the call is local in the TOC-sharing sense), which should yield
higher performance than generating the full cross-DSO indirect-call sequence
and is likely just as useful for JITed code (if not, we'll change it).

StackMaps and Patchpoints are still marked as experimental, and so this support
is doubly experimental. So go ahead and experiment!

llvm-svn: 225808
2015-01-13 17:48:12 +00:00
Daniel Sanders
d8785475d6 Added a Mips lld milestone to the release notes for the 3.6 release.
llvm-svn: 225797
2015-01-13 15:17:00 +00:00
Peter Zotov
daac044e00 Update release notes wrt OCaml bindings.
llvm-svn: 225779
2015-01-13 09:48:02 +00:00
Reid Kleckner
033ced7470 Rename llvm.recoverframeallocation to llvm.framerecover
This name is less descriptive, but it sort of puts things in the
'llvm.frame...' namespace, relating it to frameallocate and
frameaddress. It also avoids using "allocate" and "allocation" together.

llvm-svn: 225752
2015-01-13 01:51:34 +00:00
Paul Robinson
457a3390d3 Phabricator calls it "subscriber" not "cc"
llvm-svn: 225747
2015-01-13 00:50:31 +00:00
Reid Kleckner
002e480f22 Add the llvm.frameallocate and llvm.recoverframeallocation intrinsics
These intrinsics allow multiple functions to share a single stack
allocation from one function's call frame. The function with the
allocation may only perform one allocation, and it must be in the entry
block.

Functions accessing the allocation call llvm.recoverframeallocation with
the function whose frame they are accessing and a frame pointer from an
active call frame of that function.

These intrinsics are very difficult to inline correctly, so the
intention is that they be introduced rarely, or at least very late
during EH preparation.

Reviewers: echristo, andrew.w.kaylor

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

llvm-svn: 225746
2015-01-13 00:48:10 +00:00
Bill Schmidt
47f17cdeb1 First crack at PowerPC 3.6 release notes
llvm-svn: 225695
2015-01-12 20:46:43 +00:00
Daniel Sanders
716d3b6d00 Fix silly mistake in release notes for Mips.
llvm-svn: 225608
2015-01-11 10:48:20 +00:00
Daniel Sanders
73fe04fbdf Added release notes for the Mips target.
llvm-svn: 225607
2015-01-11 10:34:52 +00:00
Hans Wennborg
4c1e23124f ReleaseNotes.rst: these are for 3.6
llvm-svn: 225482
2015-01-09 00:21:26 +00:00
Duncan P. N. Exon Smith
da1e88cbe8 LangRef: Add usage points for distinct MDNodes
Omission pointed out by Sean Silva!

llvm-svn: 225479
2015-01-08 23:50:26 +00:00
Duncan P. N. Exon Smith
bc9ee9160a IR: Add 'distinct' MDNodes to bitcode and assembly
Propagate whether `MDNode`s are 'distinct' through the other types of IR
(assembly and bitcode).  This adds the `distinct` keyword to assembly.

Currently, no one actually calls `MDNode::getDistinct()`, so these nodes
only get created for:

  - self-references, which are never uniqued, and
  - nodes whose operands are replaced that hit a uniquing collision.

The concept of distinct nodes is still not quite first-class, since
distinct-ness doesn't yet survive across `MapMetadata()`.

Part of PR22111.

llvm-svn: 225474
2015-01-08 22:38:29 +00:00
Eric Christopher
09a68860d8 The Kaleidoscope tutorial should be using "mcjit" for the library,
"jit" doesn't exist anymore.

llvm-svn: 225462
2015-01-08 19:07:01 +00:00
Sean Silva
b85a13e7a0 [LangRef] PR22118: Hyphen is allowed in IR identifiers.
E.g. %-foo and %fo-o.

Thanks to eagle-eyed reporter Tomas Brukner.

llvm-svn: 225400
2015-01-07 21:35:14 +00:00
Rafael Espindola
20dc6c7571 Change the .ll syntax for comdats and add a syntactic sugar.
In order to make comdats always explicit in the IR, we decided to make
the syntax a bit more compact for the case of a GlobalObject in a
comdat with the same name.

Just dropping the $name causes problems for

@foo = globabl i32 0, comdat
$bar = comdat ...

and

declare void @foo() comdat
$bar = comdat ...

So the syntax is changed to

@g1 = globabl i32 0, comdat($c1)
@g2 = globabl i32 0, comdat

and

declare void @foo() comdat($c1)
declare void @foo() comdat

llvm-svn: 225302
2015-01-06 22:55:16 +00:00
Hal Finkel
c9c79966c3 [LangRef] Correct a typo
llvm-svn: 225148
2015-01-05 04:05:21 +00:00
Philip Reames
bebd90afce Reformat statepoint documentation and fix a couple of typos
Patch by Ramkumar Ramachandra <artagnon@gmail.com>.

llvm-svn: 225084
2015-01-02 19:46:49 +00:00
Elena Demikhovsky
60c95a11c8 Fixed 2 minor typos in the documentation.
llvm-svn: 224917
2014-12-29 09:47:51 +00:00
Elena Demikhovsky
01c94906b1 Documentation for Masked Load and Store intrinsics.
llvm-svn: 224832
2014-12-25 09:29:13 +00:00
Duncan P. N. Exon Smith
9c5542c040 IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly.  These
are the matching assembly changes for the metadata/value split in
r223802.

  - Only use the `metadata` type when referencing metadata from a call
    intrinsic -- i.e., only when it's used as a `Value`.

  - Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
    when referencing it from call intrinsics.

So, assembly like this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata !{i32 %v}, metadata !0)
      call void @llvm.foo(metadata !{i32 7}, metadata !0)
      call void @llvm.foo(metadata !1, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{metadata !3}, metadata !0)
      ret void, !bar !2
    }
    !0 = metadata !{metadata !2}
    !1 = metadata !{i32* @global}
    !2 = metadata !{metadata !3}
    !3 = metadata !{}

turns into this:

    define @foo(i32 %v) {
      call void @llvm.foo(metadata i32 %v, metadata !0)
      call void @llvm.foo(metadata i32 7, metadata !0)
      call void @llvm.foo(metadata i32* @global, metadata !0)
      call void @llvm.foo(metadata !3, metadata !0)
      call void @llvm.foo(metadata !{!3}, metadata !0)
      ret void, !bar !2
    }
    !0 = !{!2}
    !1 = !{i32* @global}
    !2 = !{!3}
    !3 = !{}

I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines).  I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.

This is part of PR21532.

llvm-svn: 224257
2014-12-15 19:07:53 +00:00
Rafael Espindola
ee596e4631 Require python 2.7.
We were already requiring 2.5, which meant that people on old linux distros
had to upgrade anyway.

Requiring python 2.6 will make supporting 3.X easier as we can use the 3.X
exception syntax.

According to the discussion on llvmdev, there is not much value is requiring
just 2.6, we may as well just require 2.7.

llvm-svn: 224129
2014-12-12 15:29:31 +00:00
Stepan Dyatkovskiy
afc2834821 Added documentation for MergeFunctions pass:
Pass looks for equivalent functions that are mergable and folds them.

llvm-svn: 223931
2014-12-10 17:42:01 +00:00
Eric Christopher
fd56b800f7 Add argument variable support to the debug info tutorial
and rearrange the prologue source location hack to immediately
after it.

llvm-svn: 223725
2014-12-09 00:28:24 +00:00
Eric Christopher
2d57946d3f Clean up the rst for the debug info tutorial
llvm-svn: 223682
2014-12-08 18:48:08 +00:00
Justin Bogner
430d01bf77 InstrProf: An intrinsic and lowering for instrumentation based profiling
Introduce the ``llvm.instrprof_increment`` intrinsic and the
``-instrprof`` pass. These provide the infrastructure for writing
counters for profiling, as in clang's ``-fprofile-instr-generate``.

The implementation of the instrprof pass is ported directly out of the
CodeGenPGO classes in clang, and with the followup in clang that rips
that code out to use these new intrinsics this ends up being NFC.

Doing the instrumentation this way opens some doors in terms of
improving the counter performance. For example, this will make it
simple to experiment with alternate lowering strategies, and allows us
to try handling profiling specially in some optimizations if we want
to.

Finally, this drastically simplifies the frontend and puts all of the
lowering logic in one place.

llvm-svn: 223672
2014-12-08 18:02:35 +00:00
Eric Christopher
662fb328d7 Add Chapter 8 to the Kaleidoscope tutorial. This chapter adds
a description of how to add debug information using DWARF and
DIBuilder to the language.

Thanks to David Blaikie for his assistance with this tutorial.

llvm-svn: 223671
2014-12-08 18:00:47 +00:00
Philip Reames
bf871401c6 Add a section to Statepoint docs mentioning shared bugzilla search and standard mailing lists
llvm-svn: 223374
2014-12-04 18:33:28 +00:00
Philip Reames
3ec8a1db50 Minor typo and link fixes for Statepoint documentation
llvm-svn: 223327
2014-12-04 00:45:23 +00:00
Nico Weber
57d7b4cc5a Fix grammar-o.
llvm-svn: 223265
2014-12-03 20:58:23 +00:00
Matt Arsenault
5fc0f8ef48 Fix sphinx error from Statepoints.rst
It was complaining it wasn't included in any toctree

llvm-svn: 223254
2014-12-03 18:35:11 +00:00
Benjamin Poulain
d00638fd57 Fix a typo in the documentation of LTO
Fix defininitions->definitions.

Reviewed by David Blaikie.

llvm-svn: 223216
2014-12-03 07:32:36 +00:00
Peter Collingbourne
837799f13b Prologue support
Patch by Ben Gamari!

This redefines the `prefix` attribute introduced previously and
introduces a `prologue` attribute.  There are a two primary usecases
that these attributes aim to serve,

  1. Function prologue sigils

  2. Function hot-patching: Enable the user to insert `nop` operations
     at the beginning of the function which can later be safely replaced
     with a call to some instrumentation facility

  3. Runtime metadata: Allow a compiler to insert data for use by the
     runtime during execution. GHC is one example of a compiler that
     needs this functionality for its tables-next-to-code functionality.

Previously `prefix` served cases (1) and (2) quite well by allowing the user
to introduce arbitrary data at the entrypoint but before the function
body. Case (3), however, was poorly handled by this approach as it
required that prefix data was valid executable code.

Here we redefine the notion of prefix data to instead be data which
occurs immediately before the function entrypoint (i.e. the symbol
address). Since prefix data now occurs before the function entrypoint,
there is no need for the data to be valid code.

The previous notion of prefix data now goes under the name "prologue
data" to emphasize its duality with the function epilogue.

The intention here is to handle cases (1) and (2) with prologue data and
case (3) with prefix data.

References
----------

This idea arose out of discussions[1] with Reid Kleckner in response to a
proposal to introduce the notion of symbol offsets to enable handling of
case (3).

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2014-May/073235.html

Test Plan: testsuite

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

llvm-svn: 223189
2014-12-03 02:08:38 +00:00
Philip Reames
f2916b94a2 [Statepoints 4/4] Statepoint infrastructure for garbage collection: Documentation
This is the fourth and final patch in the statepoint series.  It contains the documentation for the statepoint intrinsics and their usage.  

There's definitely still room to improve the documentation here, but I wanted to get this landed so it was available for others.  There will likely be a series of small cleanup changes over the next few weeks as we work to clarify and revise the documentation.  If you have comments or questions, please feel free to discuss them either in this commit thread, the original review thread, or on llvmdev.  Comments are more than welcome.

Reviewed by: atrick, ributzka
Differential Revision: http://reviews.llvm.org/D5683

llvm-svn: 223143
2014-12-02 19:37:00 +00:00
Peter Zotov
a7ec66eea2 [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.
This way most code won't link this (substantially large) library,
if compiled statically with LLVM.

llvm-svn: 223072
2014-12-01 19:50:39 +00:00
Peter Zotov
a05f11b29b [OCaml] [cmake] Add CMake buildsystem for OCaml.
Closes PR15325.

llvm-svn: 223071
2014-12-01 19:50:23 +00:00
Craig Topper
886524ee76 Remove neverHasSideEffects support from TableGen CodeGenInstruction. Everyone should use hasSideEffects now.
llvm-svn: 222809
2014-11-26 04:11:14 +00:00