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

6444 Commits

Author SHA1 Message Date
Renato Golin
e1a68583e2 [docs] Move GitHub to GitHubSubMod
Given that other proposals are making their way through, it's better if we
specify what GitHub proposal this is, in case there are others that also
involve GitHub, but not sub-modules.

llvm-svn: 276325
2016-07-21 19:52:27 +00:00
Anna Thomas
a6e42b23de Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276316.

llvm-svn: 276320
2016-07-21 19:06:28 +00:00
Anna Thomas
219ef36aa0 Invariant start/end intrinsics overloaded for address space
Summary:
The llvm.invariant.start and llvm.invariant.end intrinsics currently
support specifying invariant memory objects only in the default address space.

With this change, these intrinsics are overloaded for any adddress space for memory objects
and we can use these llvm invariant intrinsics in non-default address spaces.

Example: llvm.invariant.start.p1i8(i64 4, i8 addrspace(1)* %ptr)

This overloaded intrinsic is needed for representing final or invariant memory in managed languages.

Reviewers: tstellarAMD, reames, apilipenko

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D22519

llvm-svn: 276316
2016-07-21 18:41:44 +00:00
Renato Golin
6248146d05 Adding RELEASE_TESTERS.TXT
llvm-svn: 276302
2016-07-21 16:46:44 +00:00
Renato Golin
d1ec7af874 [docs] Update release docs
llvm-svn: 276264
2016-07-21 12:00:50 +00:00
Renato Golin
dfb328c437 [docs] Fixing Sphinx warnings to unclog the buildbot
Lots of blocks had "llvm" or "nasm" syntax types but either weren't following
the syntax, or the syntax has changed (and sphinx hasn't keep up) or the type
doesn't even exist (nasm?).

Other documents had :options: what were invalid. I only removed those that had
warnings, and left the ones that didn't, in order to follow the principle of
least surprise.

This is like this for ages, but the buildbot is now failing on errors. It may
take a while to upgrade the buildbot's sphinx, if that's even possible, but
that shouldn't stop us from getting docs updates (which seem down for quite
a while).

Also, we're not losing any syntax highlight, since when it doesn't parse, it
doesn't colour. Ie. those blocks are not being highlighted anyway.

I'm trying to get all docs in one go, so that it's easy to revert later if we
do fix, or at least easy to know what's to fix.

llvm-svn: 276109
2016-07-20 12:16:38 +00:00
Renato Golin
d542ed549e [docs] fix cmake code-block warning
This will unblock the llvm-sphinx-buildbot, which is currently failing due
to a warning being treated as error.

llvm-svn: 276100
2016-07-20 09:47:09 +00:00
Renato Golin
db1cffc65c [docs] Add proposals to index file
llvm-svn: 276099
2016-07-20 09:38:04 +00:00
Renato Golin
418e08647b [docs] GitHub Proposal for LLVM
This document was crafted from the various (320+) emails between 2nd June and
20th July regarding the move to GitHub. It tried to consolidate every issue that
was raised and every solution that was presented to have a GitHub repository
with sub-modules.

It *does not* try to argue whether sub-modules are better or worse than any other
Git solution, nor if Git is better than any other VCS, nor if GitHub is better
than any other free code hosting service. This is just the final conclusions of
48 days and 320 emails (plus a lot of IRC discussions) on the LLVM community.

This document will be presented at the survey that the foundation will setup for
us to decide if we move to this solution or not. It reflects what was discussed
on the lists, but it's not authoritative. If something is not clear enough,
please refer to the mailing list discussions (hint: search for "GitHub").

Review: https://reviews.llvm.org/D22463
llvm-svn: 276097
2016-07-20 09:09:58 +00:00
Yunzhong Gao
ceb53a60fa Fixing a few places in this doc which look like obvious typos.
llvm-svn: 276070
2016-07-20 00:40:54 +00:00
Aaron Ballman
7afb153427 This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11925/steps/docs-llvm-html/logs/stdio). Setting the code highlighting to none instead of llvm.
llvm-svn: 276060
2016-07-19 23:50:11 +00:00
Aaron Ballman
cc8c9dd51f This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11921/steps/docs-llvm-html/logs/stdio). Setting the code highlighting to none instead of llvm to hopefully get the bot stumbling back towards green.
llvm-svn: 276018
2016-07-19 20:20:03 +00:00
Aaron Ballman
694aef5995 This code block breaks the docs build (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11920/steps/docs-llvm-html/logs/stdio), but I cannot see anything immediately wrong with it and cannot reproduce the diagnostic locally. Setting the code highlighting to none instead of nasm to hopefully get the bot stumbling back towards green.
llvm-svn: 275998
2016-07-19 17:46:55 +00:00
Vedant Kumar
78dfceef4b Retry: [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads used.
Auto-detect NumThreads when it isn't specified, and avoid spawning threads when
they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Changes since the initial commit:

  - When handling odd-length inputs, call ThreadPool::wait() before merging the
    last profile. Should fix a race/off-by-one (see r275937).

Differential Revision: https://reviews.llvm.org/D22438

llvm-svn: 275938
2016-07-19 01:17:20 +00:00
Vedant Kumar
338daec4d5 Revert "[llvm-profdata] Speed up merging by using a thread pool"
This reverts commit r275921. It broke the ppc64be bot:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-multistage/builds/3537

I'm not sure why it broke, but based on the output, it looks like an
off-by-one (one profile left un-merged).

llvm-svn: 275937
2016-07-19 00:57:09 +00:00
Lang Hames
92bc82a15a [Kaleidoscope][BuildingAJIT] More work on the text for Chapter 3.
Add an overview of stubs and compile callbacks before the discussion of the
source changes.

-- This line, and those below, will be ignored--

M    docs/tutorial/BuildingAJIT3.rst

llvm-svn: 275933
2016-07-19 00:25:52 +00:00
Vedant Kumar
498432e86b [llvm-profdata] Speed up merging by using a thread pool
Add a "-j" option to llvm-profdata to control the number of threads
used. Auto-detect NumThreads when it isn't specified, and avoid spawning
threads when they wouldn't be beneficial.

I tested this patch using a raw profile produced by clang (147MB). Here is the
time taken to merge 4 copies together on my laptop:

  No thread pool: 112.87s user 5.92s system 97% cpu 2:01.08 total
  With 2 threads: 134.99s user 26.54s system 164% cpu 1:33.31 total

Differential Revision: https://reviews.llvm.org/D22438

llvm-svn: 275921
2016-07-18 22:02:39 +00:00
Hans Wennborg
23e6abebda Trunk release notes now refer to 4.0.0
llvm-svn: 275842
2016-07-18 18:02:23 +00:00
Hans Wennborg
39d26639c0 Bump the trunk version to 4.0.0svn.
Differential Revision: https://reviews.llvm.org/D21821

llvm-svn: 275827
2016-07-18 17:51:04 +00:00
Alexander Kornienko
bd04308493 Fixed errors in docs.
llvm-svn: 275789
2016-07-18 14:13:18 +00:00
Sebastian Pop
70a7aa9968 bugpoint: add flag -verbose-errors
The default behavior of bugpoint is to print "<crash>" when it finds a reduced
test that crashes compilation.  With this flag we now can see the output of the
crashing program.  This is useful to make sure it is the same error being
tracked down and not a different error that happens to crash the compiler as
well.

Differential Revision: https://reviews.llvm.org/D22411

llvm-svn: 275646
2016-07-15 23:15:06 +00:00
Vedant Kumar
d2062f3ddf [llvm-cov] Optionally use a symbol demangler when preparing reports
Add an option to specify a symbol demangler (as well as options to the
demangler). This can be used to make reports more human-readable.

This option is especially useful in -output-dir mode, since it isn't as
easy to manually pipe reports into a demangler in this mode.

llvm-svn: 275640
2016-07-15 22:44:57 +00:00
Lang Hames
f3982b3804 [Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.
llvm-svn: 275518
2016-07-15 01:39:49 +00:00
Aaron Ballman
2039ea75ff Speculatively fix the sphinx build, which does not think the original code was valid nasm (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/11854/steps/docs-llvm-html/logs/stdio).
llvm-svn: 275408
2016-07-14 13:08:16 +00:00
Chris Lattner
b9db25ac49 clarify a bit.
llvm-svn: 275364
2016-07-14 02:52:04 +00:00
Adrian Prantl
0973b9cea7 Synchronize LLVM and clang's ObjCDeclSpec::ObjCPropertyAttributeKind.
This adds Clang-specific DWARF constants for nullability and ObjC
class properties that are already generated by clang. This patch adds
dwarfdump support and a more comprehensive testcase.

<rdar://problem/27335745>

llvm-svn: 275354
2016-07-14 00:41:18 +00:00
David Blaikie
aec0fbf787 PR28516: Fix LangRef description of call and invoke to match IR changes for typeless pointers
llvm-svn: 275283
2016-07-13 17:21:34 +00:00
Etienne Bergeron
9732dd614e fix incorrect xref in sphinx doc
llvm-svn: 275255
2016-07-13 06:10:37 +00:00
Piotr Padlewski
444754c1b0 Review fixes to lit documentation
Reviewers: mehdi_amini

Subscribers: llvm-commits

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

llvm-svn: 275214
2016-07-12 20:59:17 +00:00
Hal Finkel
f6aeef6f80 Update the LangRef description of the 'returned' attribute
The description of the 'returned' attribute says that it is only used when
code-generating the caller. I'd like to make the optimizer smarter about
looking through functions with returned arguments (generally, but motivated by
my llvm.noalias work). As David pointed out in the review of D22202, the
LangRef should be updated to make its expanded uses clearer.

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

llvm-svn: 275026
2016-07-10 21:52:39 +00:00
Sean Silva
e635934d1f [docs] Fix up a broken link.
llvm-svn: 275002
2016-07-09 23:08:14 +00:00
Piotr Padlewski
486ca66440 Added REQUIRES to TestingGuide documentation
Reviewers: alexfh, wolfgangp, rengolin

Subscribers: llvm-commits

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

llvm-svn: 274949
2016-07-08 23:47:29 +00:00
Piotr Padlewski
21b711148b Fix LTO document
Summary: fixed very old document

Reviewers: tejohnson, pcc

Subscribers: mehdi_amini, eraman, llvm-commits

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

llvm-svn: 274811
2016-07-08 00:28:29 +00:00
Vedant Kumar
c62c146db0 [llvm-cov] Add support for creating html reports
Based on a patch by Harlan Haskins!

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

llvm-svn: 274688
2016-07-06 21:44:05 +00:00
Justin Bogner
18054ad909 NVPTX: Replace uses of cuda.syncthreads with nvvm.barrier0
Everywhere where cuda.syncthreads or __syncthreads is used, use the
properly namespaced nvvm.barrier0 instead.

llvm-svn: 274664
2016-07-06 20:02:45 +00:00
Paul Robinson
6450d7d138 [Conduct] Refine what "rare cases" means wrt violations outside our spaces.
Text suggested by Daniel Berlin. While it is likely to be exactly what
the advisory committee would do anyway, codifying it does no harm and
helps reassure people that rare does not mean arbitrary.

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

llvm-svn: 274659
2016-07-06 19:32:41 +00:00
Nicolai Haehnle
fe1657d8ae Add writeonly IR attribute
Summary:
This complements the earlier addition of IntrWriteMem and IntrWriteArgMem
LLVM intrinsic properties, see D18291.

Also start using the attribute for memset, memcpy, and memmove intrinsics,
and remove their special-casing in BasicAliasAnalysis.

Reviewers: reames, joker.eph

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 274485
2016-07-04 08:01:29 +00:00
Sylvestre Ledru
29d94cf96e fix some various typos in the doc
llvm-svn: 274449
2016-07-02 19:28:40 +00:00
Wilfred Hughes
394146ba2a New Kaleidoscope chapter: Creating object files
This new chapter describes compiling LLVM IR to object files.

The new chaper is chapter 8, so later chapters have been renumbered.
Since this brings us to 10 chapters total, I've also needed to rename
the other chapters to use two digit numbering.

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

llvm-svn: 274441
2016-07-02 17:01:59 +00:00
Chandler Carruth
7689f785ef Remove non-ASCII characters (silly smart quotes). Thanks to Hal for
noticing.

llvm-svn: 274289
2016-06-30 23:04:20 +00:00
Chandler Carruth
6a66d5b518 Introduce a *draft* of a code of conduct for the LLVM community and the
associated reporting guide.

I want to emphasize that at this point these are just drafts!

This is the result of very extended discussion on the mailing lists on
several different threads:
http://lists.llvm.org/pipermail/llvm-dev/2015-October/091218.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/099120.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151019/307070.html

The reporting guide in particular I anticipate will be shaped somewhat
by the advisory committee when they are selected. But hopefully this
serves as a good starting point and good guidance while the advisory
committee is being sorted out.

I'd like to thank all the folks who contributed to this. Many, *many*
people worked to help with drafting, wording, suggestions, and edits.
Also, this is based on widely used existing codes of coduct as mentioned
in the text, and the original authors of those deserve many thanks as
well.

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

llvm-svn: 274268
2016-06-30 20:27:54 +00:00
Krzysztof Parzyszek
c413d833f7 [Docs][CodeGenerator] Don't specify the number of operands in BuildMI
Patch by Visoiu Mistrih Francis.

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

llvm-svn: 274128
2016-06-29 14:14:59 +00:00
Artur Pilipenko
e2ddc2857d Support arbitrary addrspace pointers in masked load/store intrinsics
This is a resubmittion of 263158 change after fixing the existing problem with intrinsics mangling (see LTO and intrinsics mangling llvm-dev thread for details).

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: 274043
2016-06-28 18:27:25 +00:00
Vedant Kumar
d930dacca2 Reapply "[llvm-cov] Add an -output-dir option for the show sub-command""
Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if
it doesn't already exist, and prints reports into that directory.

In function view mode, all views are written into
path/to/dir/functions.$EXTENSION. In file view mode, all views are
written into path/to/dir/coverage/$PATH.$EXTENSION.

Changes since the initial commit:

- Avoid accidentally closing stdout twice.

llvm-svn: 273985
2016-06-28 02:09:39 +00:00
Vedant Kumar
b17e17f6e8 Revert "[llvm-cov] Add an -output-dir option for the show sub-command"
This reverts commit r273971. test/profile/instrprof-visibility.cpp is
failing because of an uncaught error in SafelyCloseFileDescriptor.

llvm-svn: 273978
2016-06-28 01:14:04 +00:00
Vedant Kumar
3caefadc32 [llvm-cov] Add an -output-dir option for the show sub-command
Passing -output-dir path/to/dir to llvm-cov show creates path/to/dir if
it doesn't already exist, and prints reports into that directory.

In function view mode, all views are written into
path/to/dir/functions.$EXTENSION. In file view mode, all views are
written into path/to/dir/coverage/$PATH.$EXTENSION.

llvm-svn: 273971
2016-06-28 00:18:57 +00:00
Vedant Kumar
3c185dcf6b [llvm-cov] Add a format option for the 'show' sub-command (mostly NFC)
llvm-svn: 273968
2016-06-28 00:15:54 +00:00
Wolfgang Pieb
50ace911e7 Document the ability to perform multi-line pattern matching in FileCheck.
Differential review: http://reviews.llvm.org/D21522

llvm-svn: 273962
2016-06-27 23:59:00 +00:00
Matt Arsenault
5c73422406 Verifier: Reject non-float !fpmath
Code already assumes this is float. getFPAccuracy()
crashes on any other type.

llvm-svn: 273912
2016-06-27 19:43:15 +00:00
Artur Pilipenko
f9a0655273 Revert -r273892 "Support arbitrary addrspace pointers in masked load/store intrinsics" since some of the clang tests don't expect to see the updated signatures.
llvm-svn: 273895
2016-06-27 16:54:33 +00:00
Artur Pilipenko
5d29d9eab5 Support arbitrary addrspace pointers in masked load/store intrinsics
This is a resubmittion of 263158 change after fixing the existing problem with intrinsics mangling (see LTO and intrinsics mangling llvm-dev thread for details).

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: 273892
2016-06-27 16:29:26 +00:00
Peter Collingbourne
41f4d00801 IR: Introduce llvm.type.checked.load intrinsic.
This intrinsic safely loads a function pointer from a virtual table pointer
using type metadata. This intrinsic is used to implement control flow integrity
in conjunction with virtual call optimization. The virtual call optimization
pass will optimize away llvm.type.checked.load intrinsics associated with
devirtualized calls, thereby removing the type check in cases where it is
not needed to enforce the control flow integrity constraint.

This patch also introduces the capability to copy type metadata between
global variables, and teaches the virtual call optimization pass to do so.

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

llvm-svn: 273756
2016-06-25 00:23:04 +00:00
Peter Collingbourne
e3f12b0e68 IR: New representation for CFI and virtual call optimization pass metadata.
The bitset metadata currently used in LLVM has a few problems:

1. It has the wrong name. The name "bitset" refers to an implementation
   detail of one use of the metadata (i.e. its original use case, CFI).
   This makes it harder to understand, as the name makes no sense in the
   context of virtual call optimization.

2. It is represented using a global named metadata node, rather than
   being directly associated with a global. This makes it harder to
   manipulate the metadata when rebuilding global variables, summarise it
   as part of ThinLTO and drop unused metadata when associated globals are
   dropped. For this reason, CFI does not currently work correctly when
   both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable
   globals, and fails to associate metadata with the rebuilt globals. As I
   understand it, the same problem could also affect ASan, which rebuilds
   globals with a red zone.

This patch solves both of those problems in the following way:

1. Rename the metadata to "type metadata". This new name reflects how
   the metadata is currently being used (i.e. to represent type information
   for CFI and vtable opt). The new name is reflected in the name for the
   associated intrinsic (llvm.type.test) and pass (LowerTypeTests).

2. Attach metadata directly to the globals that it pertains to, rather
   than using the "llvm.bitsets" global metadata node as we are doing now.
   This is done using the newly introduced capability to attach
   metadata to global variables (r271348 and r271358).

See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

llvm-svn: 273729
2016-06-24 21:21:32 +00:00
Tom Stellard
1bc8ee7065 Support/ELF: Add R_AMDGPU_GOTPCREL relocation
Summary:
We will start generating this in a future patch.

Reviewers: arsenm, kzhuravl, rafael, ruiu, tony-tye

Subscribers: arsenm, llvm-commits, kzhuravl

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

llvm-svn: 273628
2016-06-23 23:11:29 +00:00
Chris Lattner
7269118147 Change the email address for commit access requests to my llvm address.
llvm-svn: 273578
2016-06-23 16:29:22 +00:00
Renato Golin
57647762a7 [docs] Bump minimum version of CMake in its own doc
llvm-svn: 273570
2016-06-23 15:28:00 +00:00
Peter Collingbourne
413c7840e0 IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals.
This change is motivated by an upcoming change to the metadata representation
used for CFI. The indirect function call checker needs type information for
external function declarations in order to correctly generate jump table
entries for such declarations. We currently associate such type information
with declarations using a global metadata node, but I plan [1] to move all
such metadata to global object attachments.

In bitcode, metadata attachments for function declarations appear in the
global metadata block. This seems reasonable to me because I expect metadata
attachments on declarations to be uncommon. In the long term I'd also expect
this to be the case for CFI, because we'd want to use some specialized bitcode
format for this metadata that could be read as part of the ThinLTO thin-link
phase, which would mean that it would not appear in the global metadata block.

To solve the lazy loaded metadata issue I was seeing with D20147, I use the
same bitcode representation for metadata attachments for global variables as I
do for function declarations. Since there's a use case for metadata attachments
in the global metadata block, we might as well use that representation for
global variables as well, at least until we have a mechanism for lazy loading
global variables.

In the assembly format, the metadata attachments appear after the "declare"
keyword in order to avoid a parsing ambiguity.

[1] http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html

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

llvm-svn: 273336
2016-06-21 23:42:48 +00:00
Lang Hames
2ba72d0207 [Kaleidoscope][BuildingAJIT] Remove some superfluous commas in Chapter 2.
llvm-svn: 273184
2016-06-20 18:37:52 +00:00
Lang Hames
dad7251213 [Kaleidoscope][BuildingAJIT] Fix a punctuation mistake in Chapter 2.
llvm-svn: 273183
2016-06-20 18:34:46 +00:00
Matt Arsenault
657964bdda LangRef: Note expectations when loading with extra alignment
llvm-svn: 272914
2016-06-16 16:33:41 +00:00
David Majnemer
c6df3d773b Remove the ScalarReplAggregates pass
Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

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

llvm-svn: 272737
2016-06-15 00:19:09 +00:00
Amaury Sechet
a5ee0e6dc4 Fix list of deprecated C API attribute functions
llvm-svn: 272727
2016-06-14 22:23:29 +00:00
Peter Collingbourne
5dcb77e9fb IR: Introduce local_unnamed_addr attribute.
If a local_unnamed_addr attribute is attached to a global, the address
is known to be insignificant within the module. It is distinct from the
existing unnamed_addr attribute in that it only describes a local property
of the module rather than a global property of the symbol.

This attribute is intended to be used by the code generator and LTO to allow
the linker to decide whether the global needs to be in the symbol table. It is
possible to exclude a global from the symbol table if three things are true:
- This attribute is present on every instance of the global (which means that
  the normal rule that the global must have a unique address can be broken without
  being observable by the program by performing comparisons against the global's
  address)
- The global has linkonce_odr linkage (which means that each linkage unit must have
  its own copy of the global if it requires one, and the copy in each linkage unit
  must be the same)
- It is a constant or a function (which means that the program cannot observe that
  the unique-address rule has been broken by writing to the global)

Although this attribute could in principle be computed from the module
contents, LTO clients (i.e. linkers) will normally need to be able to compute
this property as part of symbol resolution, and it would be inefficient to
materialize every module just to compute it.

See:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160509/356401.html
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160516/356738.html
for earlier discussion.

Part of the fix for PR27553.

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

llvm-svn: 272709
2016-06-14 21:01:22 +00:00
Konstantin Zhuravlyov
035608a55b [docs] Update AMDGPU relocation information
- Added new notation for specifying relocation calculation
  - Renamed:
    - R_AMDGPU_32_LOW -> R_AMDGPU_ABS32_LO
    - R_AMDGPU_32_HIGH -> R_AMDGPU_ABS32_HI
    - R_AMDGPU_64 -> R_AMDGPU_ABS64
  - Added:
    - R_AMDGPU_REL32
    - R_AMDGPU_REL64
    - R_AMDGPU_ABS32
  - Updated calculations for relative relocations

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

llvm-svn: 272684
2016-06-14 17:20:29 +00:00
Daniel Sanders
385661593f [FileCheck] Document --check-prefixes.
llvm-svn: 272683
2016-06-14 16:42:05 +00:00
Hans Wennborg
a7650e55b0 Fix some typos in the Kaleidoscope tutorial (PR28120)
llvm-svn: 272681
2016-06-14 16:05:12 +00:00
Ulrich Weigand
a0c04be7b7 [SystemZ] Enable index register memory constraints for inline ASM
This enables use of the 'R' and 'T' memory constraints for inline ASM
operands on SystemZ, which allow an index register as well as an
immediate displacement. This patch includes corresponding documentation
and test case updates.

As with the last patch of this kind, I moved the 'm' constraint to the
most general case, which is now 'T' (base + 20-bit signed displacement +
index register).

Author: colpell
Differential Revision: http://reviews.llvm.org/D21239

llvm-svn: 272547
2016-06-13 14:24:05 +00:00
Amaury Sechet
b05a19a933 Make sure we have a Add/Remove/Has function for various thing that can have attribute.
Summary: This also deprecated the get attribute function familly.

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

Subscribers: axw, joker.eph, llvm-commits

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

llvm-svn: 272504
2016-06-12 06:17:24 +00:00
Matt Arsenault
7bddaed185 Update call site attribute documentation
convergent is also accepted.

llvm-svn: 272353
2016-06-10 00:36:57 +00:00
Tom Stellard
b49c569b73 docs: Add AMDGPU relocation information
Summary:
This documents the various relocation types that are supported by the
Radeon Open Compute (ROC) runtime (which is essentially the dynamic
linker for AMDGPU).

Only R_AMDGPU_32 is not currently supported by the ROC runtime, but
it will usually be resolved at link time by lld.

Patch by: Konstantin Zhuravlyov

Reviewers: kzhuravl, rafael

Subscribers: rafael, arsenm, llvm-commits, kzhuravl

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

llvm-svn: 272352
2016-06-10 00:31:13 +00:00
Vedant Kumar
e22d636530 [docs] Fix indentation for a tool option
llvm-svn: 272309
2016-06-09 21:09:54 +00:00
Ulrich Weigand
3a7df35715 [SystemZ] Enable long displacement constraints for inline ASM operands
This enables use of the 'S' constraint for inline ASM operands on
SystemZ, which allows for a memory reference with a signed 20-bit
immediate displacement. This patch includes corresponding documentation
and test case updates.

I've changed the 'T' constraint to match the new behavior for 'S', as
'T' also uses a long displacement (though index constraints are still
not implemented). I also changed 'm' to match the behavior for 'S' as
this will allow for a wider range of displacements for 'm', though
correct me if that's not the right decision.

Author: colpell
Differential Revision: http://reviews.llvm.org/D21097

llvm-svn: 272266
2016-06-09 15:19:16 +00:00
Kostya Serebryany
49497b4fc5 [libFuzzer] docs: merge two lines with cmake instructions, add -DLLVM_ENABLE_ASSERTIONS=ON
llvm-svn: 272088
2016-06-08 01:31:40 +00:00
Kostya Serebryany
ee5f7869e2 [docs] fix the build by including ScudoHardenedAllocator into toc; mention SourceBasedCodeCoverage.html in libFuzzer docs
llvm-svn: 272070
2016-06-07 23:13:54 +00:00
Vedant Kumar
f43ae6493c Retry^4 "[llvm-profdata] Add option to ingest filepaths from a file"
Changes since the initial commit:
- Use echo instead of printf. This should side-step the character
  escaping issues on Windows.

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

llvm-svn: 272068
2016-06-07 22:47:31 +00:00
Reid Kleckner
c7dde7db85 Add info to SourceLevelDebugging about CodeView
Adds some discussion of the nature of the format, and some developer
docs on how to work with it in LLVM.

llvm-svn: 272057
2016-06-07 20:27:30 +00:00
Lang Hames
90a9836da7 [Kaleidoscope] Update Chapter 3 of the "Implementing a Language" tutorial to
take into account modernizations in r246002 and r270381.

Patch based on http://reviews.llvm.org/D20954 by Miroslav Hrncir.
Thanks Miroslav!

llvm-svn: 271985
2016-06-07 05:40:08 +00:00
Kostya Serebryany
b9204f52d3 [sanitizer] Initial implementation of a Hardened Allocator
Summary:
This is an initial implementation of a Hardened Allocator based on Sanitizer Common's CombinedAllocator.
It aims at mitigating heap based vulnerabilities by adding several features to the base allocator, while staying relatively fast.
The following were implemented:
- additional consistency checks on the allocation function parameters and on the heap chunks;
- use of checksum protected chunk header, to detect corruption;
- randomness to the allocator base;
- delayed freelist (quarantine), to mitigate use after free and overall determinism.
Additional mitigations are in the works.

Reviewers: eugenis, aizatsky, pcc, krasin, vitalybuka, glider, dvyukov, kcc

Subscribers: kubabrecka, filcab, llvm-commits

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

llvm-svn: 271968
2016-06-07 01:20:26 +00:00
Vedant Kumar
5d5b447dbe Revert "Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file""
This reverts commit r271953. It's still breaking on Windows, though the
list initialization issue is fixed:

http://bb.pgr.jp/builders/ninja-clang-i686-msc19-R/builds/3751

llvm-svn: 271963
2016-06-06 23:43:56 +00:00
Vedant Kumar
d32e283fe4 Retry^2 "[llvm-profdata] Add option to ingest filepaths from a file"
Changes since the initial commit:
- Normalize file paths read from the file to prevent Windows path
  separators from escaping parts of the path.
- Since we need to store the normalized file paths in WeightedFile,
  don't do tricky things to keep the source MemoryBuffer alive.
- Don't use list-initialization for a std::string in WeightedFile.

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

llvm-svn: 271953
2016-06-06 23:17:22 +00:00
Vedant Kumar
196f3e9316 Revert "Retry "[llvm-profdata] Add option to ingest filepaths from a file"
This reverts commit r271949. It breaks the Windows build:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/12796

llvm-svn: 271952
2016-06-06 23:01:42 +00:00
Vedant Kumar
6357ddf5ed Retry "[llvm-profdata] Add option to ingest filepaths from a file"
Changes since the initial commit:
- Normalize file paths read from the file to prevent Windows path
  separators from escaping parts of the path.
- Since we need to store the normalized file paths in WeightedFile,
  don't do tricky things to keep the source MemoryBuffer alive.

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

llvm-svn: 271949
2016-06-06 22:39:22 +00:00
Chris Bieneman
39d503a5a9 Updating release notes for CMake version bump
CMake 3.4.3 is now required for building LLVM-based projects.

llvm-svn: 271945
2016-06-06 22:02:16 +00:00
Lang Hames
036ae3a4b2 [Kaleidoscope][BuildingAJIT] Fix hyphenation in chapter 2 title.
llvm-svn: 271924
2016-06-06 18:35:44 +00:00
Lang Hames
b9bf9fd55e [Kaleidoscope][BuildingAJIT] More cleanup of Chapter 2.
Streamline some wording, fix a bug in the markup for the layer interface table.

llvm-svn: 271917
2016-06-06 18:22:47 +00:00
Lang Hames
4f6955f990 [Kaleidoscope][BuildingAJIT] Clean up sentence, remove comments from code block.
llvm-svn: 271913
2016-06-06 18:07:23 +00:00
Lang Hames
9bad4819bf [Kaleidoscope][BuildingAJIT] Split up the code-block describing the substitution
of OptimizeLayer for CompileLayer in Chapter 2.

Hopefully this will read a little more clearly.

llvm-svn: 271868
2016-06-06 05:07:52 +00:00
Lang Hames
8b961a44c2 [Kaleidoscope][BuildingAJIT] Fix code-blocks in Chapter 2.
llvm-svn: 271867
2016-06-06 04:53:59 +00:00
Lang Hames
6c7de226cb [Kaleidoscope][BuildingAJIT] Add tutorial text for Chapter 2.
This chapter discusses IR optimizations, the ORC IRTransformLayer, and the ORC
layer concept itself.

The text is still pretty rough, but I think the main ideas are there. Feedback
is very welcome, as always.

llvm-svn: 271865
2016-06-06 03:28:12 +00:00
Chandler Carruth
85f0f82387 [llvm-profdata] Revert r271709 and the 3 subsequent commits - the code
and/or tests aren't working on Windows currently.

There seems to be some problem with quoting the file paths. I don't
understand the test structure here or the code well enough to try to
come up with a way to correctly handle paths with back slashes in them,
and this has caused the Windows builds to be failing for 7 hours now, so
I'm reverting the whole thing to bring them back to life. Sorry for the
disruption, but a couple of these were bug fixes anyways that can be
folded into a fresh commit.

Reverts the following patches:

r271756: Clean up the way we create the input filenames buffer (NFC)
r271748: Fix use-after-free from discarded MemoryBuffer (NFC)
r271710: Fix option description (NFC)
r271709: Add option to ingest filepaths from a file
llvm-svn: 271760
2016-06-04 03:08:01 +00:00
Mehdi Amini
4237db7306 Add a FIXME note in the release notes about documenting ThinLTO
llvm-svn: 271742
2016-06-03 21:45:34 +00:00
Vedant Kumar
6bbf734940 [llvm-profdata] Add option to ingest filepaths from a file
Differential Revision: http://reviews.llvm.org/D20980

llvm-svn: 271709
2016-06-03 19:05:20 +00:00
Kostya Serebryany
c17de491ba [libFuzzer] fix docs
llvm-svn: 271493
2016-06-02 06:06:34 +00:00
Kostya Serebryany
5977d5803c [libFuzzer] docs: add contact, mention more trophies
llvm-svn: 271490
2016-06-02 05:45:42 +00:00
Tamas Berghammer
362295709f Try to fix docs build after rL271440
llvm-svn: 271452
2016-06-02 00:26:18 +00:00
Tamas Berghammer
195e842656 Add new LLVM_EXTERNAL_PROJECTS option to cmake
The new option makes it possible to build external projects as part of
the llvm build without copying (or symlinking) then into llvm/tool with
specifying a few additional cmake variables.

Example usage (2 additional project called foo and bar):
-DLLVM_EXTERNAL_PROJECTS="Foo;Bar"
-DLLVM_EXTERNAL_FOO_SOURCE_DIR=/src/foo
-DLLVM_EXTERNAL_BAR_SOURCE_DIR=/src/bar

Note: This is the extension of the approach we already support for
clang/lldb/poly with adding an option to specify additional supported
projects.

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

llvm-svn: 271440
2016-06-01 23:00:45 +00:00
Sanjoy Das
ace2883be0 [IR] Disallow loading and storing unsized types
Summary:
It isn't clear what is the operational meaning of loading or storing an
unsized types, since it cannot be lowered into something meaningful.
Since there does not seem to be any practical need for it either, make
such loads and stores illegal IR.

Reviewers: majnemer, chandlerc

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 271402
2016-06-01 16:13:10 +00:00
Lang Hames
96b587081e [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.
This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo
instances from JITSymbols. It will save more mess in the future when
JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather
than just a TargetAddress, since we'll be able to embed the error checking in
the conversion.

llvm-svn: 271350
2016-05-31 23:14:26 +00:00
Peter Collingbourne
fa4e4af5c9 Add support for metadata attachments for global variables.
This patch adds an IR, assembly and bitcode representation for metadata
attachments for globals. Future patches will port existing features to use
these new attachments.

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

llvm-svn: 271348
2016-05-31 23:01:54 +00:00
Chris Bieneman
a234eb432f [CMake] Update to requiring CMake 3.4.3
Summary:
This is as per the discussions on developer lists:

http://lists.llvm.org/pipermail/llvm-dev/2016-April/098780.html
http://lists.llvm.org/pipermail/llvm-dev/2016-May/100058.html

Subscribers: llvm-commits

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

llvm-svn: 271325
2016-05-31 20:21:32 +00:00
Ahmed Bougacha
812b8f25e6 [Docs] CodeGen has supported vector icmp/fcmp for a long time.
The IR support is already well-documented.

llvm-svn: 271315
2016-05-31 18:50:05 +00:00
Lang Hames
8153ee55cd [Kaleidoscope][BuildingAJIT] Finish off Chapter 1.
* Various tidy-up and streamlining of existing discussion.
* Describes findSymbol and removeModule.

Chapter 1 is now rough but essentially complete in terms of content.

Feedback, patches etc. very welcome.

llvm-svn: 271225
2016-05-30 19:03:26 +00:00
Lang Hames
cabab5d07e [Kaleidoscope][BuildingAJIT] Add stub Chapter 5 text.
llvm-svn: 271213
2016-05-30 16:53:19 +00:00
Sean Silva
3aeb592057 [docs] Be a bit more precise.
llvm-svn: 271083
2016-05-28 01:03:36 +00:00
Lang Hames
08ff5714ba [Kaleidoscope][BuildingAJIT] Add stub chapter text for Building A JIT Chapter 4.
llvm-svn: 271064
2016-05-27 22:34:56 +00:00
Kostya Serebryany
7dfd360c85 [libFuzzer] use __sanitizer_set_report_fd with -close_fd_mask. This allows us to keep asan reports when closing target's stderr
llvm-svn: 271053
2016-05-27 21:46:22 +00:00
Chris Bieneman
875fc32428 [Docs][WritingAnLLVMBackend] Makefiles are deprecated
Summary: * docs/WritingAnLLVMBackend.rst: Makefiles are no longer used. The users should use CMakeLists.txt. In order to add the target, the TARGETS_TO_BUILD is replaced with LLVM_ALL_TARGETS.

Reviewers: gribozavr, void, beanz

Subscribers: llvm-commits

Patch By: Visoiu Mistrih Francis (thegameg)

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

llvm-svn: 270921
2016-05-26 21:31:56 +00:00
Lang Hames
e9c7d869d1 [Kaleidoscope][BuildingAJIT] Fix strong emphasis markup by removing whitespace.
llvm-svn: 270918
2016-05-26 21:21:18 +00:00
Lang Hames
fff5c0ec1c [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial.

llvm-svn: 270917
2016-05-26 21:17:06 +00:00
David Majnemer
89a8ea9137 [CaptureTracking] Volatile operations capture their memory location
The memory location that corresponds to a volatile operation is very
special.  They are observed by the machine in ways which we cannot
reason about.

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

llvm-svn: 270879
2016-05-26 17:36:22 +00:00
Lang Hames
0ee42ec4dc [Kaleidoscope][BuildingAJIT] Add a stub Chapter 2 doc.
llvm-svn: 270809
2016-05-26 00:38:04 +00:00
Lang Hames
afb30397ab [KaleidoscopeJIT][BuildingAJIT] Remove some copy-pasta from Chapter 1.
This text was accidentally left in when the original document was copied from
Chapter 7 of the Kaleidoscope language series.

llvm-svn: 270799
2016-05-25 23:42:48 +00:00
Lang Hames
e8af93083e [Kaleidoscope][BuildingAJIT] Shorten the name of the BuildingAJIT tutorial
series.

The original name was pretty long, and likely to look awkward as more
chapters get added.

llvm-svn: 270796
2016-05-25 23:34:19 +00:00
Justin Lebar
1ea09d7451 [CUDA] Add section to docs about controlling fp optimizations.
Reviewers: rnk

Subscribers: llvm-commits, tra

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

llvm-svn: 270789
2016-05-25 23:11:31 +00:00
Lang Hames
76bd1e509c [Kaleidoscope][BuildingAJIT] Fix code-block indents.
llvm-svn: 270782
2016-05-25 22:33:25 +00:00
Lang Hames
266b4e1255 [Kaleidoscope][BuildingAJIT] Add a description of the KaleidoscopeJIT addModule
method to Chapter1 of the BuildingAJIT tutorial.

llvm-svn: 270778
2016-05-25 22:27:25 +00:00
Kostya Serebryany
d0ab64cb17 [libFuzzer] document the proposed FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
llvm-svn: 270744
2016-05-25 18:41:53 +00:00
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