Commit Graph

6823 Commits

Author SHA1 Message Date
Tony Tye
af26c83f3b Correct GFX9 processor names.
Differential Revision: https://reviews.llvm.org/D33736



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307353 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 03:10:01 +00:00
George Karpenkov
80c7e63a6d [lit] Modify LIT to accept environment variable LIT_FILTER to select tests.
This is especially useful when lit is invoked indirectly by the build
system, and additional arguments can not be easily specified.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307339 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-07 00:22:11 +00:00
Chris Lattner
b9eae7a2b3 remove an unused empty file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 19:06:13 +00:00
Ilya Biryukov
45bbe61cd4 Made a script to build docker images easier to use.
Summary:
- Removed double indirection via command-line args (i.e. two `--`
  options of `build_docker_image.sh`).
- Added a comment on how to build 2-stage clang install into the
  `build_docker_image.sh`, it used to be only in the `docs/Docker.rst`.

Reviewers: klimek, mehdi_amini

Reviewed By: klimek

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-06 12:46:51 +00:00
Galina Kistanova
0aff1ea91d Added more info on silent master to the doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-05 20:45:44 +00:00
Hiroshi Inoue
bc6790d8ba fix trivial typos in documents; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306975 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-02 12:44:27 +00:00
Rafael Espindola
78fbc18aed Completely disable git/svn version checking if not needed.
Working with git on a branch I find it really annoying that committing
a change causes ninja to think that stuff needs to be rebuilt.

With this change at least nothing in llvm needs to be rebuild when
something is committed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306858 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 18:48:33 +00:00
Ilya Biryukov
0cf8704795 Fixed misplaced table border in the docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306811 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 09:47:17 +00:00
Ilya Biryukov
83aa9ad2a3 Added Dockerfiles to build clang from sources.
Reviewers: klimek, chandlerc, mehdi_amini

Reviewed By: klimek, mehdi_amini

Subscribers: mehdi_amini, jlebar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306810 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 09:46:45 +00:00
Chandler Carruth
cebf3467bc Remove the BBVectorize pass.
It served us well, helped kick-start much of the vectorization efforts
in LLVM, etc. Its time has come and past. Back in 2014:
http://lists.llvm.org/pipermail/llvm-dev/2014-November/079091.html

Time to actually let go and move forward. =]

I've updated the release notes both about the removal and the
deprecation of the corresponding C API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 07:09:08 +00:00
Eric Christopher
075dc44414 Add a C API section to the release notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306777 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-30 01:17:45 +00:00
Sam Clegg
a79c4fecfd llvm-nm: Add support for symbol demangling (-C/--demangle)
Differential Revision: https://reviews.llvm.org/D34668

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306718 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-29 18:29:05 +00:00
Sylvestre Ledru
e9d67e46c2 fix various typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306262 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-26 02:45:39 +00:00
Tanya Lattner
62a29da117 Remove test commit change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 20:13:32 +00:00
Tanya Lattner
0663649ed3 test commit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306222 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-24 20:08:28 +00:00
Ekaterina Vaartis
5cb7c56962 [docs] As of binutils 2.21.51.0.2, ld.bfd supports plugins too, represent this in docs
PR#32760



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306102 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-23 13:54:10 +00:00
whitequark
e4b1890fda Define behavior of "stack-probe-size" attribute when inlining.
Also document the attribute, since "probe-stack" already is.

Reviewed By: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306069 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-22 23:22:36 +00:00
whitequark
4c34d0afe1 Add a "probe-stack" attribute
This attribute is used to ensure the guard page is triggered on stack
overflow. Stack frames larger than the guard page size will generate
a call to __probestack to touch each page so the guard page won't
be skipped.

Reviewed By: majnemer

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-21 18:46:50 +00:00
David Blaikie
4039181fbe [Doc] Fix getelementptr description about arguments
Section "Arguments" of `getelementptr` [1] says the first argument is a
type, the second argument is a pointer or a vector of pointers, and is
the base address to start from. Update `getelementptr` FAQ [2]
accordingly, based on discussion with David on the mailing list [3].

[1] http://llvm.org/docs/LangRef.html#getelementptr-instruction
[2] http://llvm.org/docs/GetElementPtr.html
[3] http://lists.llvm.org/pipermail/llvm-dev/2017-June/114294.html

Patch by Wei-Ren Chen!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305662 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-19 05:34:21 +00:00
Daniel Neilson
470c6959b7 [Atomics] Rename and change prototype for atomic memcpy intrinsic
Summary:

Background: http://lists.llvm.org/pipermail/llvm-dev/2017-May/112779.html

This change is to alter the prototype for the atomic memcpy intrinsic. The prototype itself is being changed to more closely resemble the semantics and parameters of the llvm.memcpy intrinsic -- to ease later combination of the llvm.memcpy and atomic memcpy intrinsics. Furthermore, the name of the atomic memcpy intrinsic is being changed to make it clear that it is not a generic atomic memcpy, but specifically a memcpy is unordered atomic.

Reviewers: reames, sanjoy, efriedma

Reviewed By: reames

Subscribers: mzolotukhin, anna, llvm-commits, skatkov

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305558 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-16 14:43:59 +00:00
Matthias Braun
c82adde7b9 docs/Phabricator: Better git examples to produce full context patches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305515 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 22:09:30 +00:00
Teresa Johnson
e39601862c [Doc] Document prof metadata in LangRef
Summary:
Points to existing documentation for branch_weights and
function_entry_count, and adds an example for VP value profile metadata.

Reviewers: davidxl, reames

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-15 15:57:12 +00:00
Florian Hahn
50963b3b75 Align definition of DW_OP_plus with DWARF spec [3/3]
Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.
 
The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.
 
This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: echristo, pcc, aprantl

Reviewed By: aprantl

Subscribers: fhahn, javed.absar, aprantl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305386 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-14 13:14:38 +00:00
Florian Hahn
10ccfa6a1e Align definition of DW_OP_plus with DWARF spec [1/3]
Summary:
This patch is part of 3 patches that together form a single patch, but must be introduced in stages in order not to break things.
 
The way that LLVM interprets DW_OP_plus in DIExpression nodes is basically that of the DW_OP_plus_uconst operator since LLVM expects an unsigned constant operand. This unnecessarily restricts the DW_OP_plus operator, preventing it from being used to describe the evaluation of runtime values on the expression stack. These patches try to align the semantics of DW_OP_plus and DW_OP_minus with that of the DWARF definition, which pops two elements off the expression stack, performs the operation and pushes the result back on the stack.
 
This is done in three stages:
• The first patch (LLVM) adds support for DW_OP_plus_uconst.
• The second patch (Clang) contains changes all its uses from DW_OP_plus to DW_OP_plus_uconst.
• The third patch (LLVM) changes the semantics of DW_OP_plus and DW_OP_minus to be in line with its DWARF meaning. This patch includes the bitcode upgrade from legacy DIExpressions.

Patch by Sander de Smalen.

Reviewers: pcc, echristo, aprantl

Reviewed By: aprantl

Subscribers: fhahn, aprantl, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 16:54:44 +00:00
Brian Gesiak
a468462b6a [Lexicon] Add GVN
Summary: Add a lexicon entry for global value numbering.

Reviewers: davide, majnemer

Reviewed By: davide

Subscribers: llvm-commits, inouehrs

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305270 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-13 03:06:16 +00:00
Adrian Prantl
3f23964a39 Update LangRef for PR27284.
And reverse the ownership between DICompileUnit and DISubprogram.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 23:59:43 +00:00
Peter Collingbourne
9283a09c18 IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata.
The new metadata is easier to manipulate than module flags.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305227 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-12 20:10:48 +00:00
Zachary Turner
cfb1356863 Rename llvm-pdbdump -> llvm-pdbutil.
This is to reflect the evolving nature of the tool as being
useful for more than just dumping PDBs, as it can do many other
things.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@305106 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-09 20:46:17 +00:00
Zachary Turner
629f4edc0e Update release notes for BinaryFormat library.
Differential Revision: https://reviews.llvm.org/D34001

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 17:47:22 +00:00
Tony Tye
5db707b0ff Correct AMDGPU Hawaii and Kabini target names
The FirePro and Radeon versions of Hawaii have different 64 bit floating point configurations so use distinct target names for them. Rename the target name for Kabini to accommodate.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304959 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-08 01:47:25 +00:00
Tony Tye
04631fc848 Try to work around possible bugs in version of Shpinx on buildserver.
Builds sucessfully with Sphinx v1.5.5

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304853 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:46:08 +00:00
Tony Tye
61c7e03d0a Add documentation for various aspects of the AMDGPU backend.
Remove extra tabs.
Builds sucessfully with Sphinx v1.5.5

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304848 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-07 00:08:35 +00:00
Tony Tye
698655354d Add documentation for various aspects of the AMDGPU backend.
Differential Revision: https://reviews.llvm.org/D33736


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304831 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 20:31:59 +00:00
Nuno Lopes
bac91bf18c [docs] Make it clear shifts yield poison when shift amount >= bitwidth
Some InstCombine optimizations already rely on the result being poison
rather than undef.

For example, the following rewrite is wrong if undef is used:
; (1 << Y) * X  ->  X << Y
%Op0 = shl 1, %Y
%r = mul %Op0, %Op1
  =>
%r = shl %Op1, %Y

ERROR: Mismatch in values for i4 %r

Example:
i4 %Y = 0x8 (8, -8)
i4 %Op0 = 0x0 (0)
i4 %Op1 = 0x0 (0)
source: 0x0 (0)
target: 0x1 (1)

The optimization is correct if poison is returned instead:
http://rise4fun.com/Alive/ygX


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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304780 91177308-0d34-0410-b5e6-96231b3b80d8
2017-06-06 08:28:17 +00:00
Eli Friedman
8a5dfea89d [docs] Update name of vectorization interleave flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-31 23:02:55 +00:00
Ayal Zaks
98be03e2e2 [Docs] Add VectorizationPlan to docs/Proposals.
Following the request made in https://reviews.llvm.org/D32871, the
general documentation of the Vectorization Plan is hereby placed
under docs/Proposals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@304161 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-29 15:36:23 +00:00
Andrew Kaylor
325c68628e Add constrained intrinsics for some libm-equivalent operations
Differential revision: https://reviews.llvm.org/D32319



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303922 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 21:31:00 +00:00
Aaron Ballman
f906b5846e Update the documentation and CMake file for Visual Studio generators.
By default, CMake uses a 32-bit toolchain, even when on a 64-bit platform targeting a 64-bit build. However, due to the size of the binaries involved, this can cause linker instabilities (such as the linker running out of memory). Guide people to the correct solution to get CMake to use the native toolchain.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303912 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 21:01:30 +00:00
Adrian Prantl
a600582004 Delete an obsolete paragraph in LangRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-25 18:54:06 +00:00
Rafael Espindola
01c176bc59 Add some tips on benchmarking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303769 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-24 16:39:12 +00:00
Ayal Zaks
f93293ef42 [LV] Report multiple reasons for not vectorizing under allowExtraAnalysis
The default behavior of -Rpass-analysis=loop-vectorizer is to report only the
first reason encountered for not vectorizing, if one is found, at which time the
vectorizer aborts its handling of the loop. This patch allows multiple reasons
for not vectorizing to be identified and reported, at the potential expense of
additional compile-time, under allowExtraAnalysis which can currently be turned
on by Clang's -fsave-optimization-record and opt's -pass-remarks-missed.

Removed from LoopVectorizationLegality::canVectorize() the redundant checking
and reporting if we CantComputeNumberOfIterations, as LAI::canAnalyzeLoop() also
does that. This redundancy is caught by a lit test once multiple reasons are
reported.

Patch initially developed by Dror Barak.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303613 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-23 07:08:02 +00:00
George Burgess IV
cd631cca05 [Docs] Fix LangRef links referred in GetElementPtr.rst
Patch by chenwj!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-21 05:31:29 +00:00
Duncan P. N. Exon Smith
40549e6094 Docs: Fix pluralization in CMake docs
Fixed "most platform" to read "most platforms", and changed "are not
using the same" to "use different" as a drive-by.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 05:25:19 +00:00
George Burgess IV
fb8d01efbe [docs] Small style nits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-20 04:52:29 +00:00
Rui Ueyama
04e71cb10d Fix git command line in the Getting Started guide.
By default, git creates "llvm-project-20170507" directory,
but we want to create "llvm-project" directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303124 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-15 22:32:34 +00:00
Sanjay Patel
9f8cf56799 [Doc] Document "Splat" in the lexicon
Patch by Wei-Ren Chen (陳韋任)!

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302950 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 21:30:31 +00:00
James Y Knight
c5d0c88a98 [SPARC] Support 'f' and 'e' inline asm constraints.
Based on patch by Patrick Boettcher and Chris Dewhurst.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302911 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-12 15:59:10 +00:00
Javed Absar
a8ddcaa55f [IR] Allow attributes with global variables
This patch extends llvm-ir to allow attributes to be set on global variables.
An RFC was sent out earlier by my colleague James Molloy: http://lists.llvm.org/pipermail/cfe-dev/2017-March/053100.html
A key part of that proposal was to extend LLVM-IR to carry attributes on global variables.
This generic feature could be useful for multiple purposes.
In our present context, it would be useful to carry user specified sections for bss/rodata/data.

Reviewed by: Jonathan Roelofs, Reid Kleckner
Differential Revision: https://reviews.llvm.org/D32009



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302794 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-11 12:28:08 +00:00
Amara Emerson
8f1f7ce9d1 Introduce experimental generic intrinsics for horizontal vector reductions.
- This change allows targets to opt-in to using them instead of the log2
  shufflevector algorithm.
- The SLP and Loop vectorizers have the common code to do shuffle reductions
  factored out into LoopUtils, and now have a unified interface for generating
  reductions regardless of the preference of the target. LoopUtils now uses TTI
  to determine what kind of reductions the target wants to handle.
- For CodeGen, basic legalization support is added.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302514 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 10:43:25 +00:00
Tom Stellard
9c50cf0c6d Revert "Revert "CMake: Move sphinx detection into AddSphinxTarget.cmake""
This reverts commit r302054.

Re-commit now that I have fixes for clang/lld.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302499 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 01:41:28 +00:00
Kostya Serebryany
ea56ec314e [libFuzzer] update docs on -print_coverage/-dump_coverage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-09 01:34:27 +00:00
Reid Kleckner
d5e8a6baea Update instructions for using the experimental monorepo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302459 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:45:57 +00:00
Sanjoy Das
6bc9c98728 Add a blurb to the release notes about the WeakVH -> WeakTrackingVH transition
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-08 19:15:06 +00:00
Matthias Braun
0cb25a2a10 MIParser/MIRPrinter: Compute block successors if not explicitely specified
- MIParser: If the successor list is not specified successors will be
  added based on basic block operands in the block and possible
  fallthrough.

- MIRPrinter: Adds a new `simplify-mir` option, with that option set:
  Skip printing of block successor lists in cases where the
  parser is guaranteed to reconstruct it. This means we still print the
  list if some successor cannot be determined (happens for example for
  jump tables), if the successor order changes or branch probabilities
  being unequal.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-05 21:09:30 +00:00
Brian Gesiak
97bb64d76e [Lexicon] Add BDCE
Summary: Add an entry to the Lexicon for "BDCE."

Reviewers: jmolloy, hfinkel

Reviewed By: jmolloy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302169 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-04 16:50:37 +00:00
Tom Stellard
450661e57c Revert "CMake: Move sphinx detection into AddSphinxTarget.cmake"
This reverts commit r302025.

clang and lld need to be updated too so they don't break with this patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302054 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 17:22:23 +00:00
Tom Stellard
2891d41ee6 CMake: Move sphinx detection into AddSphinxTarget.cmake
Reviewers: chandlerc, beanz, mgorny

Reviewed By: beanz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302025 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 14:29:56 +00:00
Elad Cohen
ea59a24717 Support arbitrary address space pointers in masked gather/scatter intrinsics.
Fixes PR31789 - When loop-vectorize tries to use these intrinsics for a
non-default address space pointer we fail with a "Calling a function with a
bad singature!" assertion. This patch solves this by adding the 'vector of
pointers' argument as an overloaded type which will determine the address
space.

Differential revision: https://reviews.llvm.org/D31490



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302018 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 12:28:54 +00:00
Xin Tong
66ac3d52f5 Typo in LangRef.rst. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301985 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 23:24:12 +00:00
Alex Bradbury
6d1bf4ddc4 Improvements to TableGen/LangIntro.rst
Document the 'code' data type, and that value{15-17} is different to 
value{17-15}.

Patch by @chenwj (Wei-Ren Chen).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301920 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-02 13:47:10 +00:00
Lang Hames
8456354f64 [docs] Simplify some language for Error/cantFail in the programmer's manual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301773 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-30 17:24:52 +00:00
Matt Arsenault
ea376dae25 Add speculatable function attribute
This attribute tells the optimizer that the function may be speculated.

Patch by Tom Stellard

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301680 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 20:25:27 +00:00
Sanjoy Das
edb3c90b17 [StackMaps] Increase the size of the "location size" field
Summary:
In some cases LLVM (especially the SLP vectorizer) will create vectors
that are 256 bytes (or larger).  Given that this is intentional[0] is
likely to get more common, this patch updates the StackMap binary
format to deal with the spill locations for said vectors.

This change also bumps the stack map version from 2 to 3.

[0]: https://reviews.llvm.org/D32533#738350

Reviewers: reames, kavon, skatkov, javed.absar

Subscribers: mcrosier, nemanjai, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301615 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-28 04:48:42 +00:00
Sanjoy Das
af3c2de37e Specify something that's true in practice
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301591 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 20:55:07 +00:00
Vassil Vassilev
94e7e888f8 Sync with changes from r300825 in clang.
Generate the better include paths. Instead of #include <llvm_header.h> doxygen
produces #include "llvm/Folder/llvm_header.h"

Patch by Yuka Takahashi (D32342)!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301569 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 17:23:53 +00:00
Aaron Ballman
d3d0cd648c Fixing a malformed RST table to get the documentation bot back to green.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301545 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-27 14:33:01 +00:00
Sanjoy Das
263da12ab2 Reverts commit r301424, r301425 and r301426
Commits were:

"Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts"
"Add a new WeakVH value handle; NFC"
"Rename WeakVH to WeakTrackingVH; NFC"

The changes assumed pointers are 8 byte aligned on all architectures.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:37:05 +00:00
Sanjoy Das
d0cf26e443 Rename WeakVH to WeakTrackingVH; NFC
Summary:
I plan to use WeakVH to mean "nulls itself out on deletion, but does
not track RAUW" in a subsequent commit.

Reviewers: dblaikie, davide

Reviewed By: davide

Subscribers: arsenm, mehdi_amini, mcrosier, mzolotukhin, jfb, llvm-commits, nhaehnle

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301424 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-26 16:20:52 +00:00
Galina Kistanova
02ad713833 Cosmetic change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301253 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 21:06:29 +00:00
Galina Kistanova
3d88243825 Small addition on how to add a builder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 20:48:40 +00:00
George Karpenkov
6f76a43cea Updates documentation for a syntax sugar libfuzzer flag,
as implemented in https://reviews.llvm.org/D32193

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 18:39:52 +00:00
Matt Arsenault
666020a37d AMDGPU: Move trap lowering to DAG
Fixes traps in any block besides the entry block,
and fixes depending on a live-in physical register
by using a virtual register copy.

Also happens to stop emitting a nop in the case
debug trap is not supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:49:13 +00:00
George Karpenkov
e6dc33fc17 Testing commit credentials
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301200 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-24 17:28:32 +00:00
Kamil Rytarowski
bb7651ba99 Update documentation for the NetBSD target
LLVM is known to work on NetBSD x86 32-bit and 64-bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301081 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-22 16:11:23 +00:00
Andrew Kaylor
f7c70afb60 Fix formatting of constrained FP intrinsic documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-20 18:18:36 +00:00
Sanjoy Das
ef5181372f Statepoint Docs: fix incorrect uses of it's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300797 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:55:03 +00:00
Philip Reames
a716933950 Refresh the statepoint docs a bit
The documentation had gotten a bit stale.  The revised one are by no means perfect, but I tried to remove the obvious incorrect or misleading statements.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-19 23:16:13 +00:00
Adrian Prantl
b560ea777b PR32382: Fix emitting complex DWARF expressions.
The DWARF specification knows 3 kinds of non-empty simple location
descriptions:
1. Register location descriptions
  - describe a variable in a register
  - consist of only a DW_OP_reg
2. Memory location descriptions
  - describe the address of a variable
3. Implicit location descriptions
  - describe the value of a variable
  - end with DW_OP_stack_value & friends

The existing DwarfExpression code is pretty much ignorant of these
restrictions. This used to not matter because we only emitted very
short expressions that we happened to get right by accident.  This
patch makes DwarfExpression aware of the rules defined by the DWARF
standard and now chooses the right kind of location description for
each expression being emitted.

This would have been an NFC commit (for the existing testsuite) if not
for the way that clang describes captured block variables. Based on
how the previous code in LLVM emitted locations, DW_OP_deref
operations that should have come at the end of the expression are put
at its beginning. Fixing this means changing the semantics of
DIExpression, so this patch bumps the version number of DIExpression
and implements a bitcode upgrade.

There are two major changes in this patch:

I had to fix the semantics of dbg.declare for describing function
arguments. After this patch a dbg.declare always takes the *address*
of a variable as the first argument, even if the argument is not an
alloca.

When lowering a DBG_VALUE, the decision of whether to emit a register
location description or a memory location description depends on the
MachineLocation — register machine locations may get promoted to
memory locations based on their DIExpression. (Future) optimization
passes that want to salvage implicit debug location for variables may
do so by appending a DW_OP_stack_value. For example:
  DBG_VALUE, [RBP-8]                        --> DW_OP_fbreg -8
  DBG_VALUE, RAX                            --> DW_OP_reg0 +0
  DBG_VALUE, RAX, DIExpression(DW_OP_deref) --> DW_OP_reg0 +0

All testcases that were modified were regenerated from clang. I also
added source-based testcases for each of these to the debuginfo-tests
repository over the last week to make sure that no synchronized bugs
slip in. The debuginfo-tests compile from source and run the debugger.

https://bugs.llvm.org/show_bug.cgi?id=32382
<rdar://problem/31205000>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300522 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-18 01:21:53 +00:00
Peter Collingbourne
6163b4af73 Bitcode: Add a string table to the bitcode format.
Add a top-level STRTAB block containing a string table blob, and start storing
strings for module codes FUNCTION, GLOBALVAR, ALIAS, IFUNC and COMDAT in
the string table.

This change allows us to share names between globals and comdats as well
as between modules, and improves the efficiency of loading bitcode files by
no longer using a bit encoding for symbol names. Once we start writing the
irsymtab to the bitcode file we will also be able to share strings between
it and the module.

On my machine, link time for Chromium for Linux with ThinLTO decreases by
about 7% for no-op incremental builds or about 1% for full builds. Total
bitcode file size decreases by about 3%.

As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2017-April/111732.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300464 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-17 17:51:36 +00:00
Kostya Serebryany
2bb40bf078 [libFuzzer] more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300366 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-14 20:11:16 +00:00
Matthias Braun
dc1a361ccd MIRLangRef: Add a section on simplifying .mir tests
Differential Revision: http://reviews.llvm.org/D32058

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 23:45:14 +00:00
Matthias Braun
1130138bb1 MIRLangRef: Simplify/update documentation
- Refer to options by `-option` instead of `option`
- Use `-mtriple=` instead of `-march` in the example (-march will still
  target the default operating system which is usually not what you want
  in a test)
- Rephrase sentence because output does not go to stdout by default (you
  need -o - for that as should be expected).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300268 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 22:14:45 +00:00
George Burgess IV
d613770733 Remove more lies from the LangRef.
Same change as in r300168, but for invoke instead of call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 05:00:31 +00:00
George Burgess IV
c1231f81ae Update the LangRef to reflect reality.
At the very least, we have CallInst::setIsNoInline() for adding the
noinline attribute to callsites, and I'm told alwaysinline seems to
work.

Thought of adding "not all attributes are guaranteed to work here". If
someone thinks that would be better (or has a better way of phrasing
that, etc.), happy to add it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300168 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-13 04:01:55 +00:00
Sanjay Patel
2c5adb18ba [InstCombine] fix wrong undef handling when converting select to shuffle
As discussed in:
https://bugs.llvm.org/show_bug.cgi?id=32486
...the canonicalization of vector select to shufflevector does not hold up
when undef elements are present in the condition vector. 

Try to make the undef handling clear in the code and the LangRef.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300092 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 18:39:53 +00:00
Piotr Padlewski
715890b279 [LangRef] fix documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300050 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 11:18:19 +00:00
Piotr Padlewski
3512d22fea Invariant.group and mustalias docs fixes
Summary:
Alias analysis would like to know that
invariant.group.barrier returns pointer that mustalias,
but this can't imply that we can replace one pointer with another

Reviewers: dberlin, sanjoy

Subscribers: llvm-commits, chandlerc, hfinkel, nlewycky, amharc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300033 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-12 07:59:35 +00:00
Andrew Kaylor
b66309b465 Minor updates to floating point intrinsic documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299991 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-11 21:52:40 +00:00
Matt Arsenault
e0b3c335a2 Allow DataLayout to specify addrspace for allocas.
LLVM makes several assumptions about address space 0. However,
alloca is presently constrained to always return this address space.
There's no real way to avoid using alloca, so without this
there is no way to opt out of these assumptions.

The problematic assumptions include:
- That the pointer size used for the stack is the same size as
  the code size pointer, which is also the maximum sized pointer.

- That 0 is an invalid, non-dereferencable pointer value.

These are problems for AMDGPU because alloca is used to
implement the private address space, which uses a 32-bit
index as the pointer value. Other pointers are 64-bit
and behave more like LLVM's notion of generic address
space. By changing the address space used for allocas,
we can change our generic pointer type to be LLVM's generic
pointer type which does have similar properties.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299888 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-10 22:27:50 +00:00
Dean Michael Berris
af703fae1e [XRay][docs] Fix hyperlink to XRay doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299624 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-06 04:26:26 +00:00
Gor Nishanov
f202abfbd6 [coroutines] Add syntax coloring to examples in Coroutines.rst
Subscribers: EricWF

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299517 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-05 05:26:26 +00:00
Evgeniy Stepanov
8719ab145a Change section flag character for SHF_LINK_ORDER to "o".
GAS uses "m" as a compatibility alias for "M" (SHF_MERGE).

"o" is free, except on ia64, where it already means SHF_LINK_ORDER.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-04 22:35:08 +00:00
Tim Northover
9d740a4a71 Update stale doxygen links in ProgrammersManual.rst
Patch by Wei-Ren Chen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299395 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 22:24:32 +00:00
Joel Jones
5b2afe9ffb Fix LLVMBuild.txt typo. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299373 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 18:21:50 +00:00
Peter Collingbourne
7bceb16031 Bitcode: Remove reader support for MODULE_CODE_PURGEVALS.
Support for writing this module code was removed in r73220, which was well
before the LLVM 3.0 release, so we do not need to be able to understand it
for backwards compatibility.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299370 91177308-0d34-0410-b5e6-96231b3b80d8
2017-04-03 17:58:48 +00:00
Dean Michael Berris
8cefdcb5f6 [XRay][docs] Add XRayExample to docindex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299172 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-31 02:51:19 +00:00
Dean Michael Berris
21463ca861 [XRay][docs] Examples for how to use XRay
Summary:
This document is an attempt at showing how XRay could be used to debug
latency issues with LLVM tools, and how to use the llvm-xray tool to
analyse XRay traces.

Reviewers: echristo, mehdi_amini, davide

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299133 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 23:46:36 +00:00
Matt Arsenault
9065c48517 LangRef: Don't refer to a 'generic' address space.
Consistently call this the default address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@299131 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-30 23:36:47 +00:00
Rafael Espindola
31e9ec9aa5 Fix GettingStarted.rst statement.
Patch by Wei-Ren Chen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298995 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-29 14:27:38 +00:00
Adam Nemet
5c57c1108e [IR] Add AllowContract to FastMathFlags
-ffp-contract=fast does not currently work with LTO because it's passed as a
TargetOption to the backend rather than in the IR. This adds it to
FastMathFlags.

This is toward fixing PR25721

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298939 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-28 20:11:52 +00:00
Reid Kleckner
122446a916 Document how to fetch monorepo SVN revision notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298733 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-24 20:47:41 +00:00
Adrian Prantl
fbf2dadfa5 Document the status quo of DIExpression semantics in LangRef.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-22 18:01:01 +00:00
George Burgess IV
3479ed63a6 Let llvm.objectsize be conservative with null pointers
This adds a parameter to @llvm.objectsize that makes it return
conservative values if it's given null.

This fixes PR23277.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 20:08:59 +00:00
Reid Kleckner
3b53072816 Fix RST docs AttributeList heading underline
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298398 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 17:05:00 +00:00
Reid Kleckner
6707770d48 Rename AttributeSet to AttributeList
Summary:
This class is a list of AttributeSetNodes corresponding the function
prototype of a call or function declaration. This class used to be
called ParamAttrListPtr, then AttrListPtr, then AttributeSet. It is
typically accessed by parameter and return value index, so
"AttributeList" seems like a more intuitive name.

Rename AttributeSetImpl to AttributeListImpl to follow suit.

It's useful to rename this class so that we can rename AttributeSetNode
to AttributeSet later. AttributeSet is the set of attributes that apply
to a single function, argument, or return value.

Reviewers: sanjoy, javed.absar, chandlerc, pete

Reviewed By: pete

Subscribers: pete, jholewinski, arsenm, dschuff, mehdi_amini, jfb, nhaehnle, sbc100, void, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298393 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-21 16:57:19 +00:00
Jonathan Roelofs
56d588a775 Mention that the Sphinx docs build wants version 1.5 or later
`misc.highlighting_failure` support was added to `suppress_warnings` in that
version, and the warnings-as-errors docs build relies on it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-20 17:49:36 +00:00
Evgeniy Stepanov
7c45253e30 Fix docs-llvm-html build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298163 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17 22:31:13 +00:00
Evgeniy Stepanov
df808fe215 Add !associated metadata.
This is an ELF-specific thing that adds SHF_LINK_ORDER to the global's section
pointing to the metadata argument's section. The effect of that is a reverse dependency
between sections for the linker GC.

!associated does not change the behavior of global-dce. The global
may also need to be added to llvm.compiler.used.

Since SHF_LINK_ORDER is per-section, !associated effectively enables
fdata-sections for the affected globals, the same as comdats do.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@298157 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-17 22:17:24 +00:00
Rong Xu
6f00c7bc4d Resubmit r297897: [PGO] Value profile for size of memory intrinsic calls
R297897 inadvertently enabled annotation for memop profiling. This new patch
fixed it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 21:15:48 +00:00
Eric Liu
9dd65de00d Revert "[PGO] Value profile for size of memory intrinsic calls"
This commit reverts r297897 and r297909.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297951 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-16 13:16:35 +00:00
Rong Xu
670b4228b0 [PGO] Value profile for size of memory intrinsic calls
This patch adds the value profile support to profile the size parameter of
memory intrinsic calls: memcpy, memcmp, and memmov.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-15 21:47:27 +00:00
Daniel Berlin
a9c06e75f1 Fix some indenting and line-wrapping issues identified in ProgrammersManual. Make description of debugCounters a little clearer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297656 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-13 19:09:23 +00:00
Daniel Berlin
b9513eac4a Add documentation on debug counters to Programmers Manual.
Reviewers: mehdi_amini

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297575 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-12 04:46:41 +00:00
Daniel Berlin
57bd1ea8eb Remove opt-bisect support for "cases" in favor of debug counters
Summary:
Ths "cases" support was not quite finished, is unused, and is really just debug counters.
(well, almost, debug counters are slightly more powerful, in that they can skip things at the start, too).
Note, opt-bisect itself could also be implemented as a wrapper around
debug counters, but not sure it's worth it ATM.

I'll shove it on a todo list if we think it is.

Reviewers: MatzeB, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297542 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-11 01:41:03 +00:00
Artem Belevich
bb9779aa2e [FileCheck] Added --enable-var-scope option to enable scope for regex variables.
If `--enable-var-scope` is in effect, variables with names that
start with `$` are considered to be global. All other variables are
local. All local variables get undefined at the beginning of each
CHECK-LABEL block. Global variables are not affected by CHECK-LABEL.
This makes it easier to ensure that individual tests are not affected
by variables set in preceding tests.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297396 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 17:59:04 +00:00
Sanjay Patel
dccf5a1320 [InstSimplify] vector div/rem with any zero element in divisor is undef
This was suggested as a DAG simplification in the review for rL297026 :
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20170306/435253.html
...but let's start with IR since we have actual docs for IR (LangRef).

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297390 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-09 16:20:52 +00:00
Konstantin Zhuravlyov
2cee5cc825 [DebugInfo] Emit address space with DW_AT_address_class attribute for pointer and reference types
Differential Revision: https://reviews.llvm.org/D29670


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 23:55:44 +00:00
Konstantin Zhuravlyov
df032da7f1 [DebugInfo] Make legal and emit DW_OP_swap and DW_OP_xderef
Differential Revision: https://reviews.llvm.org/D29672


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297247 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-08 00:28:57 +00:00
Gor Nishanov
2d33745172 [coroutines] Add handling for unwind coro.ends
Summary:
The purpose of coro.end intrinsic is to allow frontends to mark the cleanup and
other code that is only relevant during the initial invocation of the coroutine
and should not be present in resume and destroy parts.

In landing pads coro.end is replaced with an appropriate instruction to unwind to
caller. The handling of coro.end differs depending on whether the target is
using landingpad or WinEH exception model.

For landingpad based exception model, it is expected that frontend uses the
`coro.end`_ intrinsic as follows:

```
    ehcleanup:
      %InResumePart = call i1 @llvm.coro.end(i8* null, i1 true)
      br i1 %InResumePart, label %eh.resume, label %cleanup.cont

    cleanup.cont:
      ; rest of the cleanup

    eh.resume:
      %exn = load i8*, i8** %exn.slot, align 8
      %sel = load i32, i32* %ehselector.slot, align 4
      %lpad.val = insertvalue { i8*, i32 } undef, i8* %exn, 0
      %lpad.val29 = insertvalue { i8*, i32 } %lpad.val, i32 %sel, 1
      resume { i8*, i32 } %lpad.val29

```
The `CoroSpit` pass replaces `coro.end` with ``True`` in the resume functions,
thus leading to immediate unwind to the caller, whereas in start function it
is replaced with ``False``, thus allowing to proceed to the rest of the cleanup
code that is only needed during initial invocation of the coroutine.

For Windows Exception handling model, a frontend should attach a funclet bundle
referring to an enclosing cleanuppad as follows:

```
    ehcleanup:
      %tok = cleanuppad within none []
      %unused = call i1 @llvm.coro.end(i8* null, i1 true) [ "funclet"(token %tok) ]
      cleanupret from %tok unwind label %RestOfTheCleanup
```

The `CoroSplit` pass, if the funclet bundle is present, will insert
``cleanupret from %tok unwind to caller`` before
the `coro.end`_ intrinsic and will remove the rest of the block.

Reviewers: majnemer

Reviewed By: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297223 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 21:00:54 +00:00
Ayman Musa
b59d8041db [X86][AVX512] Adding new LLVM TableGen backend which generates the EVEX2VEX compressing tables.
X86EvexToVex machine instruction pass compresses EVEX encoded instructions by replacing them with their identical VEX encoded instructions when possible.
It uses manually supported 2 large tables that map the EVEX instructions to their VEX ideticals.
This TableGen backend replaces the tables by automatically generating them.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@297127 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-07 08:11:19 +00:00
Sylvestre Ledru
d2a4d59de7 Revert commit r296967, no typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296984 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-05 07:46:24 +00:00
Sylvestre Ledru
f15590a7fb Fix a typo. Patch by fcrick on github https://github.com/llvm-mirror/llvm/pull/23
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296969 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 14:01:38 +00:00
Sylvestre Ledru
99aada9bea Remove redundant code block and update comment.
By patch zoren here: https://github.com/llvm-mirror/llvm/pull/20



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296968 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 14:00:44 +00:00
Sylvestre Ledru
d64d538640 Fix a typo. Thanks to huangml. Reported here: https://github.com/llvm-mirror/llvm/pull/6
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296967 91177308-0d34-0410-b5e6-96231b3b80d8
2017-03-04 13:56:11 +00:00
Dean Michael Berris
7577713c9b [XRay][Docs] Update the XRay documentation
Summary:
Update the XRay docs to mention new subcomands to the llvm-xray tool,
and details on FDR mode logging. Also list down available libraries for
use part of the LLVM distribution.

Reviewers: rSerge, pelikan, echristo, timshen, sdardis, rengolin

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 22:01:26 +00:00
Dehao Chen
e26c421c66 Add function importing info from samplepgo profile to the module summary.
Summary: For SamplePGO, the profile may contain cross-module inline stacks. As we need to make sure the profile annotation happens when all the hot inline stacks are expanded, we need to pass this info to the module importer so that it can import proper functions if necessary. This patch implemented this feature by emitting cross-module targets as part of function entry metadata. In the module-summary phase, the metadata is used to build call edges that points to functions need to be imported.

Reviewers: mehdi_amini, tejohnson

Reviewed By: tejohnson

Subscribers: davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 18:09:44 +00:00
Lang Hames
97a1c1b90e [docs] Fix a think-o in the Programmer's Manual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296421 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-28 01:35:31 +00:00
Lang Hames
530cc1a7c8 [Support][Error] Add a 'cantFail' utility function for known-safe calls to
fallible functions.

Some fallible functions (those returning Error or Expected<T>) may only fail
for a subset of their inputs. For example, a "safe" square root function will
succeed for all finite positive inputs:

  Expected<double> safeSqrt(double d) {
    if (d < 0 && !isnan(d) && !isinf(d))
      return make_error<...>("Cannot sqrt -ve values, nans or infs");
    return sqrt(d);
  }

At a safe callsite for such a function, checking the error return value is
redundant:

  if (auto ValOrErr = safeSqrt(42.0)) {
    // use *ValOrErr.
  } else
    llvm_unreachable("safeSqrt should always succeed for +ve values");

The cantFail function wraps this check and extracts the contained value,
simplifying control flow:

  double Result = cantFail(safeSqrt(42.0));

This function should be used with care: it is a programmatic error to wrap a
call with cantFail if it can in fact fail. For debug builds this will
result in llvm_unreachable being called. For release builds the behavior is
undefined.

Use of this function is likely to be rare in library code, but more common
for tool and unit-test code where inputs and mock functions may be known to be
safe.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296384 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-27 21:09:47 +00:00
Piotr Padlewski
79b977862e [Doc] Modernize programmers manual
Summary:
Fixed bunch of for loops to range based for loop
and bunch of rendundat types with auto.

Reviewers: echristo, silvas, chandlerc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-25 10:33:37 +00:00
Tobias Grosser
34c1d56ba3 [docs] Add information about how to checkout polly to getting started page
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295974 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 14:27:07 +00:00
Eli Friedman
e597c2c861 Explicitly state the behavior of inbounds with a null pointer.
See https://llvm.org/bugs/show_bug.cgi?id=31439; this reflects LLVM's
behavior in practice, and should be compatible with C/C++ rules.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295916 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-23 00:48:18 +00:00
Wei Ding
8d22e6f3bb AMDGPU : AMDGPU : Update AMDGPU Trap Handler ABI.
Differential Revision: http://reviews.llvm.org/D29913

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295745 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-21 18:48:01 +00:00
Ismail Donmez
f93e288abc Update Bugzilla URLs in docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-17 08:26:11 +00:00
Sanjoy Das
6980b109cd [LangRef] Explicitly allow readnone and reaodnly functions to unwind
Summary:
This change edits the language reference to explicitly allow the
existence of readnone and readonly functions that can throw.  Full
discussion at
http://lists.llvm.org/pipermail/llvm-dev/2017-January/108637.html

Reviewers: dberlin, chandlerc, hfinkel, majnemer

Reviewed By: majnemer

Subscribers: majnemer, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295000 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 23:19:07 +00:00
Sanjoy Das
c812cd6542 [LangRef] Update the TBAA section
Summary:
Update the TBAA section to mention the struct path TBAA that LLVM
implements today.  This is not a proposal or change in semantics -- it
is intended only to **document** what LLVM already does today.

This is related to https://reviews.llvm.org/D26438 where I've tried to
implement some of the constraints as verifier checks.

Reviewers: anna, reames, rsmith, chandlerc, hfinkel, rjmccall, mehdi_amini, dexonsmith, manmanren

Reviewed By: manmanren

Subscribers: dberlin, dberris, mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-13 23:14:03 +00:00
Mehdi Amini
e0ae1eda9c Update Kaleidoscope tutorial and improve Windows support
Many quoted code blocks were not in sync with the actual toy.cpp
files. Improve tutorial text slightly in several places.
Added some step descriptions crucial to avoid crashes (like
InitializeNativeTarget* calls).
Solve/workaround problems with Windows (JIT'ed method not found, using
custom and standard library functions from host process).

Patch by: Moritz Kroll <moritz.kroll@gmx.de>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294870 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 21:26:52 +00:00
Aaron Ballman
342bf77f71 Correcting several sphinx errors; should fix the LLVM documentation build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294865 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-11 18:45:24 +00:00
Dehao Chen
d0b28d942d Encode duplication factor from loop vectorization and loop unrolling to discriminator.
Summary:
This patch starts the implementation as discuss in the following RFC: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106532.html

When optimization duplicates code that will scale down the execution count of a basic block, we will record the duplication factor as part of discriminator so that the offline process tool can find the duplication factor and collect the accurate execution frequency of the corresponding source code. Two important optimization that fall into this category is loop vectorization and loop unroll. This patch records the duplication factor for these 2 optimizations.

The recording will be guarded by a flag encode-duplication-in-discriminators, which is off by default.

Reviewers: probinson, aprantl, davidxl, hfinkel, echristo

Reviewed By: hfinkel

Subscribers: mehdi_amini, anemet, mzolotukhin, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294782 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 21:09:07 +00:00
Mehdi Amini
00b42cc2f1 Fix doc for -opt-bisect-limit: the LTO option prefix for lld is -mllvm
Thanks Davide to catch it in my previous patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294759 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 17:16:00 +00:00
Mehdi Amini
2fabd44db6 Fix doc for -opt-bisect-limit: the LTO option is linker specific
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294725 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 07:21:06 +00:00
Wei Ding
c75c94d0eb AMDGPU : Add trap handler support.
Differential Revision: http://reviews.llvm.org/D26010

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294692 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 02:15:29 +00:00
Matthias Braun
05638abb6d docs/conf.py: Suppress sphinx highlighting failure warnings
The pygments syntax highlighting package used by sphinx fails to parse
newer LLVM constructs or valid (at least to me) gas constructs like
`.secrel32 _function_name + 0`.

Disable this particular warning so the build doesn't abort as fixing
pygments doesn't seem a workable option here.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294672 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-10 00:00:22 +00:00
Hans Wennborg
07a58ad1e0 Don't try to link to the 4.0 release notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294647 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:03:34 +00:00
Matthias Braun
9e6fc42f4f lit.rst: Fix sphinx complaint about multiple option definitions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294646 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:03:22 +00:00
Jonathan Roelofs
65b9667f0a [docs] Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 23:02:37 +00:00
Kostya Kortchinsky
4795c086b6 [docs] Documentation update for Scudo
Summary:
Documentation update to reflect the changes that occured in the allocator:
- additional architectures support;
- modification of the header;
- options default values for 32 & 64-bit.

Reviewers: kcc, alekseyshl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294595 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 16:07:52 +00:00
Rafael Espindola
5a2d92c7cf Make it possible to set SHF_LINK_ORDER explicitly.
This will make it possible to add support for gcing user metadata
(asan for example).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294589 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 14:59:20 +00:00
David Bozier
56b920f6fe [docs] cleanup documentation on lit substitutions
1. Added missing substitutions to the documentation in docs/TestingGuide.rst
2. Modified docs/CommandGuide/lit.rst to only document the "base" set of substitutions and to refer the reader to docs/TestingGuide.rst for more detailed info on substitutions.

Patch by bd1976llvm

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294586 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-09 14:12:30 +00:00
Sanjoy Das
9ac774d7cf Fix the docs build
(and add a bit of formatting.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294347 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 20:36:03 +00:00
Daniel Berlin
f2da6f93fe This patch adds a ssa_copy intrinsic, as part of splitting up D29316.
Summary:
The intrinsic, marked as returning it's first argument, has no code
generation effect (though currently not every optimization pass knows
that intrinsics with the returned attribute can be looked through).

It is about to be used to by the PredicateInfo pass to attach
predicate information to existing operands, and be able to tell what
the predicate information affects.

We deliberately do not attach any info through a second operand so
that the intrinsics do not need to dominate the comparisons/etc (since
in the case of assume, we may want to push them up the post-dominator
tree).

Reviewers: davide, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294341 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 19:29:25 +00:00
Sanjoy Das
a0be0b1390 [ImplicitNullCheck] Extend Implicit Null Check scope by using stores
Summary:
This change allows usage of store instruction for implicit null check.

Memory Aliasing Analisys is not used and change conservatively supposes
that any store and load may access the same memory. As a result
re-ordering of store-store, store-load and load-store is prohibited.

Patch by Serguei Katkov!

Reviewers: reames, sanjoy

Reviewed By: sanjoy

Subscribers: atrick, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294338 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-07 19:19:49 +00:00
Reid Kleckner
2a4edb648f [LangRef] Document some LLVM inline asm special escapes
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2017-February/109862.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294204 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-06 18:08:45 +00:00
Dylan McKay
c24ff540a8 [docs] Document the staging buildbot
Summary:
This also adds docs to suggest that maintainers of buildbots for
experimental backends should use this buildmaster.

Reviewers: dsanders, grosser, asb, mehdi_amini

Reviewed By: grosser

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294144 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 21:21:23 +00:00
Vedant Kumar
2006b414f1 [llvm-cov] Don't show function summaries when filtering by filename (fixes PR31395)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294137 91177308-0d34-0410-b5e6-96231b3b80d8
2017-02-05 20:11:08 +00:00
Peter Collingbourne
043d1a96c9 MC: Introduce the ABS8 symbol modifier.
@ABS8 can be applied to symbols which appear as immediate operands to
instructions that have a 8-bit immediate form for that operand. It causes
the assembler to use the 8-bit form and an 8-bit relocation (e.g. R_386_8
or R_X86_64_8) for the symbol.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293667 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-31 18:28:44 +00:00
Alexey Bader
7726f8808d [LanRef] Fix typo in getelementptr example.
Summary: Change B type from double to pointer to double.

Reviewers: delena, sanjoy

Reviewed By: sanjoy

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293467 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-30 07:38:58 +00:00
Matthias Braun
d6da5dbf7b Use print() instead of dump() in code
The dump() functions are meant to be used in a debugger, code should
typically use something like print(errs());

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293365 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-28 02:47:46 +00:00
Justin Lebar
16270ea540 Update NVVMReflect usage doc to new idiom for adding target-specific early passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293327 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 19:44:24 +00:00
Justin Lebar
0c6a4bdbb7 [LangRef] Make @llvm.sqrt(x) return undef, rather than have UB, for negative x.
Summary:
Some frontends emit a speculate-and-select idiom for sqrt, wherein they compute
sqrt(x), check if x is negative, and select NaN if it is:

  %cmp = fcmp olt double %a, -0.000000e+00
  %sqrt = call double @llvm.sqrt.f64(double %a)
  %ret = select i1 %cmp, double 0x7FF8000000000000, double %sqrt

This is technically UB as the LangRef is written today if %a is ever less than
-0.  But emitting code that's compliant with the current definition of sqrt
would require a branch, which would then prevent us from matching this idiom in
SelectionDAG (which we do today -- ISD::FSQRT has defined behavior on negative
inputs), because SelectionDAG looks at one BB at a time.

Nothing in LLVM takes advantage of this undefined behavior, as far as we can
tell, and the fact that llvm.sqrt has UB dates from its initial addition to the
LangRef.

Reviewers: arsenm, mehdi_amini, hfinkel

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293242 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-27 00:58:03 +00:00
Andrew Kaylor
e6f10d3481 Add intrinsics for constrained floating point operations
This commit introduces a set of experimental intrinsics intended to prevent
optimizations that make assumptions about the rounding mode and floating point
exception behavior.  These intrinsics will later be extended to specify
flush-to-zero behavior.  More work is also required to model instruction
dependencies in machine code and to generate these instructions from clang
(when required by pragmas and/or command line options that are not currently
supported).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293226 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 23:27:59 +00:00
Zvi Rackover
8f4444960f [Doc][LangRef] Fix typo-ish error in description of Masked Gather
Summary: Fix the example of equivalent expansion for when mask is all ones.

Reviewers: delena

Reviewed By: delena

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293206 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-26 20:29:15 +00:00
Peter Collingbourne
39a5a41160 LangRef: Document the allowed metadata dropping transforms.
Document the current practice regarding dropping metadata on modules,
functions and global variables.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 21:50:14 +00:00
Greg Parker
4a50c7f39c Reinstate "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

This reverts the revert in r292942.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@293007 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-25 02:26:03 +00:00
Alex Lorenz
a9970f0c85 Revert "r292904 - [lit] Allow boolean expressions in REQUIRES and XFAIL
and UNSUPPORTED"

After r292904 llvm-lit fails to emit the test results in the XML format for
Apple's internal buildbots.

rdar://30164800


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292942 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 16:17:04 +00:00
Greg Parker
7664071405 [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. 
Comma-separated expressions act as if each expression were on its own 
condition line:
For REQUIRES, if every expression is true then the test will run. 
For UNSUPPORTED, if every expression is false then the test will run. 
For XFAIL, if every expression is false then the test is expected to succeed. 
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux 
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax: 
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier. 
* Substrings of the target triple are true identifiers for UNSUPPORTED 
 and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292904 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 09:58:02 +00:00
Greg Parker
288f4223ce Revert "[lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED"
This change needs to be better-coordinated with libc++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292900 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 08:58:20 +00:00
Greg Parker
ebc14fff52 [lit] Allow boolean expressions in REQUIRES and XFAIL and UNSUPPORTED
A `lit` condition line is now a comma-separated list of boolean expressions. 
Comma-separated expressions act as if each expression were on its own 
condition line:
For REQUIRES, if every expression is true then the test will run. 
For UNSUPPORTED, if every expression is false then the test will run. 
For XFAIL, if every expression is false then the test is expected to succeed. 
As a special case "XFAIL: *" expects the test to fail.

Examples:
# Test is expected fail on 64-bit Apple simulators and pass everywhere else
XFAIL: x86_64 && apple && !macosx
# Test is unsupported on Windows and on non-Ubuntu Linux 
# and supported everywhere else
UNSUPPORTED: linux && !ubuntu, system-windows

Syntax: 
* '&&', '||', '!', '(', ')'. 'true' is true. 'false' is false.
* Each test feature is a true identifier. 
* Substrings of the target triple are true identifiers for UNSUPPORTED 
  and XFAIL, but not for REQUIRES. (This matches the current behavior.)
* All other identifiers are false.
* Identifiers are [-+=._a-zA-Z0-9]+

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292896 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-24 08:45:50 +00:00
Ahmed Bougacha
868b1fe194 [AArch64][GlobalISel] Legalize narrow scalar ops again.
Since r279760, we've been marking as legal operations on narrow integer
types that have wider legal equivalents (for instance, G_ADD s8).
Compared to legalizing these operations, this reduced the amount of
extends/truncates required, but was always a weird legalization decision
made at selection time.

So far, we haven't been able to formalize it in a way that permits the
selector generated from SelectionDAG patterns to be sufficient.

Using a wide instruction (say, s64), when a narrower instruction exists
(s32) would introduce register class incompatibilities (when one narrow
generic instruction is selected to the wider variant, but another is
selected to the narrower variant).

It's also impractical to limit which narrow operations are matched for
which instruction, as restricting "narrow selection" to ranges of types
clashes with potentially incompatible instruction predicates.

Concerns were also raised regarding  MIPS64's sign-extended register
assumptions, as well as wrapping behavior.
See discussions in https://reviews.llvm.org/D26878.

Instead, legalize the operations.

Should we ever revert to selecting these narrow operations, we should
try to represent this more accurately: for instance, by separating
a "concrete" type on operations, and an "underlying" type on vregs, we
could move the "this narrow-looking op is really legal" decision to the
legalizer, and let the selector use the "underlying" vreg type only,
which would be guaranteed to map to a register class.

In any case, we eventually should mitigate:
- the performance impact by selecting no-op extract/truncates to COPYs
  (which we currently do), and the COPYs to register reuses (which we
  don't do yet).
- the compile-time impact by optimizing away extract/truncate sequences
  in the legalizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292827 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-23 21:10:05 +00:00
Sean Silva
80b90fe5c1 [docs] Point to upstream Sphinx install instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292752 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-22 03:47:49 +00:00
Peter Collingbourne
b786258fde docs: Document that !absolute_symbol { all-ones, all-ones } means the full set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292657 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-20 21:56:37 +00:00
Malcolm Parsons
08536b81ae [docs] Tell Doxygen to expand LLVM_ALIGNAS to nothing
Summary:
Docs for clang::Decl and clang::TemplateSpecializationType have
not been generated since LLVM_ALIGNAS was added to them.

Tell Doxygen to expand LLVM_ALIGNAS to nothing as described at
https://www.stack.nl/~dimitri/doxygen/manual/preprocessing.html

Reviewers: aaron.ballman, klimek, alexfh

Subscribers: ioeric, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292483 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-19 13:37:42 +00:00
Graydon Hoare
57f557b15d [lit] Support sharding testsuites, for parallel execution.
Summary:
This change equips lit.py with two new options, --num-shards=M and
--run-shard=N (set by default from env vars LIT_NUM_SHARDS and LIT_RUN_SHARD).

The options must be used together, and N must be in 1..M.

Together these options effect only test selection: they partition the testsuite
into M equal-sized "shards", then select only the Nth shard. They can be used
in a cluster of test machines to achieve a very crude (static) form of
parallelism, with minimal configuration work.

Reviewers: modocache, ddunbar

Reviewed By: ddunbar

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 18:12:20 +00:00
Kostya Serebryany
26071eb844 [libFuzzer] better link for trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:45:02 +00:00
Mehdi Amini
84b54a1994 Fix GettingStarted doc so that the example build command for cmake LLVM_ENABLE_PROJECTS works on linux
I tested the previous one on macOS, however building libc++ on Linux
requires libcxxabi as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:23:08 +00:00
Aaron Ballman
e38a9b5204 Silence some Sphinx diagnostics in an attempt to get the documentation builder back to green (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/1895).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:48:31 +00:00
Justin Lebar
289cd40b51 [NVPTX] Add blank line to NVPTXUsage.rst to appease the Sphinx.
Fixes:

  Warning, treated as error:
  /home/buildbot/llvm-build-dir/llvm-sphinx-docs/llvm/src/docs/NVPTXUsage.rst:333:
  ERROR: Error in "code-block" directive:
  maximum 1 argument(s) allowed, 17 supplied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292148 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-16 18:39:15 +00:00
Justin Lebar
352f7fdadc [NVPTX] Let there be One True Way to set NVVMReflect params.
Summary:
Previously there were three ways to inform the NVVMReflect pass whether
you wanted to flush denormals to zero:

  * An LLVM command-line option
  * Parameters to the NVVMReflect constructor
  * Metadata on the module itself.

This change removes the first two, leaving only the third.

The motivation for this change, aside from simplifying things, is that
we want LLVM to be aware of whether it's operating in FTZ mode, so other
passes can use this information.  Ideally we'd have a target-generic
piece of metadata on the module.  This change moves us in that
direction.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292068 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 16:54:35 +00:00
Mehdi Amini
a9134d2526 Add a LLVM_USE_LINKER that defines the linker to use when building LLVM
Summary:
This string parameter is passed to -fuse-ld when linking. It can be
an absolute path to your custom linker, otherwise clang will look for
`ld.{name}`.

Reviewers: davide, tejohnson, pcc

Subscribers: llvm-commits, mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-15 03:21:30 +00:00
Sylvestre Ledru
1d6becb423 fix some typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292014 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-14 11:37:01 +00:00
Rui Ueyama
47a876a72c Add a description how to checkout the LLD repository.
Differential Revision: https://reviews.llvm.org/D28687

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291948 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-13 19:27:18 +00:00
Hans Wennborg
50082b152d Clear the release notes for 5.0.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291836 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 21:50:22 +00:00
Hans Wennborg
f6fc33e0fd Bump trunk version to 5.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291815 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-12 21:22:36 +00:00
Matt Arsenault
70dde8fbf5 LangRef: Note that calls also support fast math flags
This is already documented on the call instruction, but
not in the list of supported instructions in the fast math
flag section.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291578 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-10 18:06:38 +00:00
Justin Lebar
a4679c0caf [Docs] Update docs to indicate that CUDA compilation is supported on Windows.
Subscribers: cfe-commits, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291139 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 16:54:28 +00:00
Anmol P. Paralkar
b1151ef50b [doc] Fix minor grammatical error in Phabricator.rst
Summary: Test commit, fix minor grammatical error in Phabricator.rst

Reviewers: delcypher

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291101 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-05 13:08:14 +00:00
Michal Gorny
a50b783ab7 [cmake] Add LLVM_ENABLE_DIA_SDK option, and expose it in LLVMConfig
Add an explicit LLVM_ENABLE_DIA_SDK option to control building support
for DIA SDK-based debugging. Control its value to match whether DIA SDK
support was found and expose it in LLVMConfig (alike LLVM_ENABLE_ZLIB).

Its value is needed for LLDB to determine whether to run tests requiring
DIA support. Currently it is obtained from llvm/Config/config.h;
however, this file is not available for standalone builds. Following
this change, LLDB will be modified to use the value from LLVMConfig.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290818 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 18:19:35 +00:00
Keno Fischer
e345a27f2d Reapply "[CodeGen] Fix invalid DWARF info on Win64"
This reapplies rL289013 (reverted in rL289014) with the fixes identified
in D21731. Should hopefully pass the buildbots this time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290809 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-02 03:00:19 +00:00
Florian Hahn
f4ae367c89 [doc] Clarify steps for contributors without commit access.
Summary: Update the Phabricator docs to clarify how changes are merged for contributors without commit access. 

Reviewers: delcypher, aaron.ballman

Subscribers: aaron.ballman, anmol, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290767 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 21:28:30 +00:00
Piotr Padlewski
35f35d388e [MemDep] Handle gep with zeros for invariant.group
Summary:
gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.

Simple case like

    void g(A &a) {
        z(a);
        if (glob)
            a.foo();
    }
    void testG() {
        A a;
        g(a);
    }

was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis

Reviewers: dberlin, nlewycky, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290763 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-30 18:45:07 +00:00
Igor Laevsky
dedd623ace Fix documentation generator warnings after rL290708.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290709 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29 15:08:57 +00:00
Igor Laevsky
f755153552 Introduce element-wise atomic memcpy intrinsic
This change adds a new intrinsic which is intended to provide memcpy functionality
with additional atomicity guarantees. Please refer to the review thread
or language reference for further details.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290708 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-29 14:31:07 +00:00
Mehdi Amini
390d667cee [doc] Add mention of the difference in optimization level between Release and RelWithDebInfo in Cmake.rst
This is surprising to many people.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290556 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-26 23:42:12 +00:00
Amjad Aboud
4e2e80b609 [DebugInfo] Added support for Checksum debug info feature.
Differential Revision: https://reviews.llvm.org/D27642

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-25 10:12:09 +00:00
Bryant Wong
8830eb8360 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290501 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-24 17:26:38 +00:00
David Blaikie
b0d6793fd5 Fix missing '>' in docs (hopefully fixes bot error... )
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:43:48 +00:00
David Blaikie
bf89173855 Add some brief documentation about GDB pretty printers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-20 17:33:58 +00:00
Daniel Jasper
8de3a54f07 Revert @llvm.assume with operator bundles (r289755-r289757)
This creates non-linear behavior in the inliner (see more details in
r289755's commit thread).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290086 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-19 08:22:17 +00:00
Reid Kleckner
36850aafe2 Fix some remaining documentation references to MSVC 2013
MSVC 2015 has been the minimum supported version of VS since October.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289854 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 19:08:02 +00:00
Kostya Serebryany
94ab0f2699 [libFuzzer] doc update
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 18:47:22 +00:00
Pavel Labath
2ef2a887ad Simplify format member detection in FormatVariadic
Summary:
This replaces the format member search, which was quite complicated, with a more
direct approach to detecting whether a class should be formatted using the
format-member method. Instead we use a special type llvm::format_adapter, which
every adapter must inherit from. Then the search can be simply implemented with
the is_base_of type trait.

Aside from the simplification, I like this way more because it makes it more
explicit that you are supposed to use this type only for adapter-like
formattings, and the other approach (format_provider overloads) should be used
as a default (a mistake I made when first trying to use this library).

The only slight change in behaviour here is that now choose the format-adapter
branch even if the format member invocation will fail to compile (e.g. because it is a
non-const member function and we are passing a const adapter), whereas
previously we would have gone on to search for format_providers for the type.
However, I think that is actually a good thing, as it probably means the
programmer did something wrong.

Reviewers: zturner, inglorion

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289795 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 09:40:27 +00:00
Hal Finkel
fe647d2183 Make processing @llvm.assume more efficient by using operand bundles
There was an efficiency problem with how we processed @llvm.assume in
ValueTracking (and other places). The AssumptionCache tracked all of the
assumptions in a given function. In order to find assumptions relevant to
computing known bits, etc. we searched every assumption in the function. For
ValueTracking, that means that we did O(#assumes * #values) work in InstCombine
and other passes (with a constant factor that can be quite large because we'd
repeat this search at every level of recursion of the analysis).

Several of us discussed this situation at the last developers' meeting, and
this implements the discussed solution: Make the values that an assume might
affect operands of the assume itself. To avoid exposing this detail to
frontends and passes that need not worry about it, I've used the new
operand-bundle feature to add these extra call "operands" in a way that does
not affect the intrinsic's signature. I think this solution is relatively
clean. InstCombine adds these extra operands based on what ValueTracking, LVI,
etc. will need and then those passes need only search the users of the values
under consideration. This should fix the computational-complexity problem.

At this point, no passes depend on the AssumptionCache, and so I'll remove
that as a follow-up change.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289755 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-15 02:53:42 +00:00
Kostya Serebryany
68f637f244 [libFuzzer] document one more desired feature of a fuzz target
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289622 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-14 01:31:21 +00:00
Peter Collingbourne
b29976c54b IR, X86: Understand !absolute_symbol metadata on global variables.
Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289087 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 19:01:00 +00:00
Keno Fischer
3f98c183ca Revert "[CodeGen] Fix invalid DWARF info on Win64"
Appears to break on build bots. Reverting pending investigation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289014 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 01:56:23 +00:00
Keno Fischer
94c20c0a62 [CodeGen] Fix invalid DWARF info on Win64
The relocations for `DIEEntry::EmitValue` were wrong for Win64
(emitting FK_Data_4 instead of FK_SecRel_4). This corrects that
oversight so that the DWARF data is correct in Win64 COFF files.

Fixes PR15393.

Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch
by David Majnemer.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-08 01:40:21 +00:00
Mehdi Amini
bb4cc15a59 [doc] Add .arcconfig setup to the "how to work with a monorepo" section
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288562 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-03 01:04:40 +00:00
Peter Collingbourne
a705e0edef IR: Move NumElements field from {Array,Vector}Type to SequentialType.
Now that PointerType is no longer a SequentialType, all SequentialTypes
have an associated number of elements, so we can move that information to
the base class, allowing for a number of simplifications.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 03:20:58 +00:00
Peter Collingbourne
9c9ec72b63 IR: Change PointerType to derive from Type rather than SequentialType.
As proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/106640.html

This is for a couple of reasons:

- Values of type PointerType are unlike the other SequentialTypes (arrays
  and vectors) in that they do not hold values of the element type. By moving
  PointerType we can unify certain aspects of how the other SequentialTypes
  are handled.
- PointerType will have no place in the SequentialType hierarchy once
  pointee types are removed, so this is a necessary step towards removing
  pointee types.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-12-02 03:05:41 +00:00
Jonas Devlieghere
fc89a6a1e9 Revert 'Test commit as per developer policy'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 08:24:43 +00:00
Jonas Devlieghere
bc02eec1d3 Test commit as per developer policy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-30 08:06:23 +00:00
Zachary Turner
29916a15c8 Add documentation for the PDB Module Info stream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288205 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 22:14:56 +00:00
Mehdi Amini
c72d18a2cb [docs] Typos and whitespace fixed in LTO docs.
While reading the LTO docs I fixed few small typos and whitespace issues.

Patch by: Jonas Devlieghere <jonas@devlieghere.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-29 18:00:31 +00:00
Yichao Yu
3806d81f86 Fix doc of llvm.bitreverse.iN
Summary:
The return type is `iN` rather than always `i16`

Seems to be a typo in https://reviews.llvm.org/rL252878 .

Reviewers: jmolloy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287769 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-23 16:25:31 +00:00
Justin Lebar
ac4f8e1d52 [CUDA] Note in docs that you need to build with -lcudart on MacOS
-lcudart_static doesn't work.  We don't know why.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287715 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-22 23:13:29 +00:00
Matthias Braun
9262f00f1a Timer: Track name and description.
The previously used "names" are rather descriptions (they use multiple
words and contain spaces), use short programming language identifier
like strings for the "names" which should be used when exporting to
machine parseable formats.

Also removed a unused TimerGroup from Hexxagon.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 19:43:18 +00:00
Craig Topper
3d85988107 [Docs][TableGen] Remove reference to tablegen supporting octal integers. It doesn't and hasn't for at least 9 years.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 02:28:50 +00:00
Justin Lebar
e65e5ddefe [CUDA] Update docs to indicate that MacOS is now supported.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 00:42:00 +00:00
Justin Lebar
46f85978dc [CUDA] Update docs; CUDA 8.0 is supported as of a while ago.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287289 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-18 00:41:40 +00:00
Dylan McKay
b28b8f21ef [ReleaseNotes] Mention the completion of the upstreaming of the AVR backend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 22:26:09 +00:00
Kostya Serebryany
f6d63ccc90 [libFuzzer] better documentation for -fsanitize-coverage=trace-cmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 17:31:54 +00:00
Justin Lebar
38b5ba060c [CUDA] Update docs to indicate that clang now supports std::complex in CUDA mode.
The last remaining necessary change was D25403, landed as r287012.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-17 01:03:42 +00:00
Dean Michael Berris
30d8d0833f [XRay][docs] Define requirements on installed log handlers.
Summary:
We update the documentation to define what the requirements are for the
provided XRay log handler. This is to make it clear that the function
pointer provided must do internal synchronisation and that there are no
guarantees provided by XRay on when the function shall be invoked once
it has been installed as a log handler.

Reviewers: rSerge, rengolin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@287073 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-16 02:18:23 +00:00
Matt Arsenault
ee23318db7 TableGen: Add operator !or
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286936 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-15 06:49:28 +00:00
Zachary Turner
576eea861d [PDB] Add documentation for the DBI Stream.
Differential Revision: https://reviews.llvm.org/D26552

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286853 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 17:59:28 +00:00
Zachary Turner
3b7c9b9cdb [PDB] Add documentation for the PDB Stream.
https://reviews.llvm.org/D26516

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286852 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-14 17:59:21 +00:00
Sanjoy Das
00eb18da3b [LangRef] Drop misleading anecdote
`shl nsw i8 1, i8 8` is poison, but `mul i8 1, i8 128` is not.

This was discussed previously here:
http://lists.llvm.org/pipermail/llvm-dev/2015-April/084195.html.  From
the discussion, it was not clear which semantics we want for `shl`, but
for now at least make the language reference more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-13 23:40:40 +00:00
Sylvestre Ledru
8a6ccbeaaa As we released 3.9, from the 4.0 release notes, points to version 3.9 instead of 3.8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286719 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 10:39:09 +00:00
whitequark
18c0ee2638 [OCaml] Adapt to the new attribute C API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286705 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 03:38:30 +00:00
Kostya Serebryany
be3001891b [libFuzzer] one more trophy
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286703 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-12 02:55:45 +00:00
Zachary Turner
97dac2b41d [Support] Introduce llvm::formatv() function.
This introduces a new type-safe general purpose formatting
library.  It provides compile-time type safety, does not require
a format specifier (since the type is deduced), and provides
mechanisms for extending the format capability to user defined
types, and overriding the formatting behavior for existing types.

This patch additionally adds documentation for the API to the
LLVM programmer's manual.

Mailing List Thread:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105836.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286682 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 23:57:40 +00:00
Piotr Padlewski
797e9cdb75 NFC ProgrammersManual fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286645 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-11 22:12:15 +00:00
Peter Collingbourne
ca668e1942 IR: Introduce inrange attribute on getelementptr indices.
If the inrange keyword is present before any index, loading from or
storing to any pointer derived from the getelementptr has undefined
behavior if the load or store would access memory outside of the bounds of
the element selected by the index marked as inrange.

This can be used, e.g. for alias analysis or to split globals at element
boundaries where beneficial.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-July/102472.html

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286514 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 22:34:55 +00:00
Zachary Turner
ab792ca2d9 [PDB] Begin adding documentation for the PDB file format.
Differential Revision: https://reviews.llvm.org/D26374

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 19:24:21 +00:00
Sanjoy Das
40cc2d91fd [LangRef] Drop "experimental" caveat from operand bundles
I think we're past that point now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-10 06:21:10 +00:00
Dean Michael Berris
2adde22ecd [XRay][docs] Fix llvm snippets to be well-formed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 02:12:13 +00:00
Mehdi Amini
9e4483688b [doc] Remove explicit CMake version requirement for MSVC
The global minimum one is way past this version.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 01:44:42 +00:00
Dean Michael Berris
f70da781a9 [XRay][Docs] Add documentation for XRay in LLVM
Summary:
This is the initial version of the documentation for how to use XRay as
it stands in LLVM, Clang, and compiler-rt. We leave some room for later
expansion mentioining what is work in progress and what could be
expected moving forward.

We also give a high level overview of future work that's both ongoing
and planned.

Reviewers: echristo, dblaikie, chandlerc

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-09 00:24:58 +00:00
Kostya Serebryany
9a9bc142bf [libFuzzer] minor docs update
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 21:57:37 +00:00
Sanjay Patel
a897799dc7 [docs] fix link to AMD manuals (PR30946)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08 16:49:24 +00:00
Lang Hames
3fab9364ac [docs] Add a pointer to ExitOnError to the discussion of handleErrors in the
programmer's manual.

ExitOnError is often a better alternative to handleErrors for tool code. This
patch makes it easier to find the ExitOnError discussion when reading the
handleErrors section.

Thanks to Peter Collingbourne for the suggestion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286167 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:33:13 +00:00
Mehdi Amini
d2b417a57c [doc] Add documentation about how to use a monorepo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:14:09 +00:00
Mehdi Amini
ffe516c55a Add experimental support for unofficial monorepo-like directory layout
Summary:
This allows to have clang and llvm and the other subprojects
side-by-side instead of nested. This can be used with the monorepo or
multiple repos.

It will help having a single set of sources checked out but allows to
have a build directory with llvm and another one with llvm+clang.
Basically it abstracts LLVM_EXTERNAL_xxxx_SOURCE_DIR making it more
convenient by adopting a convention.

Reviewers: bogner, beanz, jlebar

Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286162 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 22:13:38 +00:00
Mehdi Amini
ad83acaba5 Revert "Add some facilities to work with a git monorepo (experimental setup)"
This reverts commit r286123, accidentally commited while testing itself...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 17:43:08 +00:00
Mehdi Amini
644ae71ae0 Add some facilities to work with a git monorepo (experimental setup)
Summary:
Some changes are made to cmake, especially the addition of a new
LLVM_ENABLE_PROJECTS option that makes the build system aware of
the monorepo directory structure.

Also a new script is added in llvm/utils/git-svn/. When present in
the $PATH, it enables a `git llvm` command. It is providing at this
point only the ability to push from the git monorepo: `git llvm push`.
It is intended to evolves with more features, for instance I plan on
features like `git llvm show r284955` to help working with sequential
revision numbers.
The push feature is taken from Justin Lebar's script available here:
https://github.com/jlebar/llvm-repo-tools/

Reviewers: jlebar

Subscribers: mgorny, modocache, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286123 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 17:40:28 +00:00
Brian Gesiak
069db88a3b Update CommandLine.rst getRegisteredOptions example
Summary: Update the docs to match the changes in http://reviews.llvm.org/D7132

Reviewers: beanz, llvm-commits, modocache

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286094 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-07 02:43:01 +00:00
Amaury Sechet
4a6fc8bacf Kill deprecated attribute API
Summary:
This kill various depreacated API related to attribute :
 - The deprecated C API attribute based on LLVMAttribute enum.
 - The Raw attribute set format (planned to be removed in 4.0).

Reviewers: bkramer, echristo, mehdi_amini, void

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286062 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-06 07:48:46 +00:00
Ahmed Bougacha
bbf0c3a5ae [docs] Add initial Global ISel documentation.
This reflects the current state of Global ISel.  As progress is
made, we'll document our design decisions in it.
Comments very welcome!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286002 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-04 17:57:34 +00:00
Kostya Serebryany
2d1f4f5e9e [libFuzzer] fix -error_exitcode=N, now with a test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285958 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-03 19:31:18 +00:00
Vedant Kumar
a0a6883ade [docs] Fix some typos. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285772 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 23:55:50 +00:00
Alex Bradbury
0ba26af40d [RISCV] Add stub backend
This contains just enough for lib/Target/RISCV to compile. Notably a basic 
RISCVTargetMachine and RISCVTargetInfo. At this point you can attempt llc 
-march=riscv32 myinput.ll and will find it fails due to the lack of 
MCAsmInfo.

See http://lists.llvm.org/pipermail/llvm-dev/2016-August/103748.html for 
further discussion

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285712 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-01 17:27:54 +00:00