Commit Graph

7010 Commits

Author SHA1 Message Date
Tony Tye
2b4b7fe362 [AMDGPU] Remove use of OpenCL triple environment and replace with function attribute for AMDGPU
- Remove use of the opencl and amdopencl environment member of the target triple for the AMDGPU target.
- Use function attribute to communicate to the AMDGPU backend to add implicit arguments for OpenCL kernels for the AMDHSA OS.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328349 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-23 18:45:18 +00:00
Matt Morehouse
590f2e2f2e Document optforfuzzing attribute created in r328214.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328236 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-22 19:50:10 +00:00
Craig Topper
de69937494 [Docs] Remove some WIP X86 documentation I accidentally leaked into r328031.
I didn't mean to commit it, but I guess I failed to switch branches or stash it in my local tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328124 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 17:32:57 +00:00
Eugene Zelenko
8dce0ebcda [Documentation] Fix markup problems in X86Usage.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 17:24:04 +00:00
Eugene Zelenko
e9a0122a40 [Documentation] Fix markup problem in AMDGPUUsage.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328116 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 17:09:35 +00:00
Sanjay Patel
f169e120a7 [LangRef] add note about format of FP types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328105 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 15:22:09 +00:00
Sanjay Patel
16e9a29021 [LangRef] more hyphens: always write "floating-point"
We were inconsistent, sometimes even within a single sentence.
The consensus seems clear that the FP we're looking for is
spelled "floating-point". Without the hyphen, it's a 
"surprisingly fine" jazz album.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328098 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-21 14:15:33 +00:00
Craig Topper
17ab24c8db [TableGen] Pass result of std::unique to vector::erase instead of calculating a size and calling resize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328031 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 20:24:10 +00:00
Sanjay Patel
f60cf82ca0 [LangRef] fix link formatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328001 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 17:05:19 +00:00
Sanjay Patel
a61bf37968 [LangRef] describe the default FP environment
Follow-up for D44216: add a section and examples to describe the FP env.
Also, add pointers from the FP instructions to this new section to reduce
bloat.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327998 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 16:38:22 +00:00
Sjoerd Meijer
3f8e03ebb0 [Kaleidoscope] doc fix
This fixes the compile command of the example in Chapter 2.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 15:37:15 +00:00
Andrea Di Biagio
9d81521985 [Release Notes] Add release note for llvm-mca.
Differential Revision: https://reviews.llvm.org/D44636


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327965 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-20 10:25:36 +00:00
Nicolai Haehnle
ce04a4a4e7 TableGen: Remove the cast-from-string-to-variable-reference feature
Summary:
Cast-from-string for records isn't going away, but cast-from-string for
variables is a pretty dodgy feature to have, especially when referencing
template arguments. It's doubtful that this ever worked in a reliable
way, and nobody seems to be using it, so let's get rid of it and get
some related cleanups.

Change-Id: I395ac8a43fef4cf98e611f2f552300d21e99b66a

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327844 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-19 14:13:37 +00:00
Jonas Devlieghere
a8b19e082c [dsymutil] Rename llvm-dsymutil -> dsymutil
Now that almost all functionality of Apple's dsymutil has been
upstreamed, the open source variant can be used as a drop in
replacement. Hence we feel it's no longer necessary to have the llvm
prefix.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327790 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-18 11:38:41 +00:00
Oren Ben Simhon
10c992c085 [X86] Added support for nocf_check attribute for indirect Branch Tracking
X86 Supports Indirect Branch Tracking (IBT) as part of Control-Flow Enforcement Technology (CET).
IBT instruments ENDBR instructions used to specify valid targets of indirect call / jmp.
The `nocf_check` attribute has two roles in the context of X86 IBT technology:
	1. Appertains to a function - do not add ENDBR instruction at the beginning of the function.
	2. Appertains to a function pointer - do not track the target function of this pointer by adding nocf_check prefix to the indirect-call instruction.

This patch implements `nocf_check` context for Indirect Branch Tracking.
It also auto generates `nocf_check` prefixes before indirect branchs to jump tables that are guarded by range checks.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327767 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-17 13:29:46 +00:00
Reid Kleckner
025ee4f9cc [IR] Avoid the need to prefix MS C++ symbols with '\01'
Now the Windows mangling modes ('w' and 'x') do not do any mangling for
symbols starting with '?'. This means that clang can stop adding the
hideous '\01' leading escape. This means LLVM debug logs are less likely
to contain ASCII escape characters and it will be easier to copy and
paste MS symbol names from IR.

Finally.

For non-Windows platforms, names starting with '?' still get IR
mangling, so once clang stops escaping MS C++ names, we will get extra
'_' prefixing on MachO. That's fine, since it is currently impossible to
construct a triple that uses the MS C++ ABI in clang and emits macho
object files.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327734 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-16 20:13:32 +00:00
Nicolai Haehnle
af0de5073c TableGen: Add !ne, !le, !lt, !ge, and !gt comparisons
Change-Id: I8e2ece677268972d578a787467f7ef52a1f33a71

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327496 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:57 +00:00
Nicolai Haehnle
8ed1fd468a TableGen: Type-check BinOps
Additionally, allow more than two operands to !con, !add, !and, !or
in the same way as is already allowed for !listconcat and !strconcat.

Change-Id: I9659411f554201b90cd8ed7c7e004d381a66fa93

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327494 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:43 +00:00
Nicolai Haehnle
14236ebc9c TableGen: Allow ? in lists
This makes using !dag more convenient in some cases.

Change-Id: I0a8c35e15ccd1ecec778fd1c8d64eee38d74517c

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327493 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:33 +00:00
Nicolai Haehnle
231876457f TableGen: Add !dag function for construction
This allows constructing DAG nodes with programmatically determined
names, and can simplify constructing DAG nodes in other cases as
well.

Also, add documentation and some very simple tests for the already
existing !con.

Change-Id: Ida61cd82e99752548d7109ce8da34d29da56a5f7

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327492 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-14 11:00:26 +00:00
Vedant Kumar
f7b39ab9df Remove the LoopInstSimplify pass (-loop-instsimplify)
LoopInstSimplify is unused and untested. Reading through the commit
history the pass also seems to have a high maintenance burden.

It would be best to retire the pass for now. It should be easy to
recover if we need something similar in the future.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327329 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12 20:49:42 +00:00
Dmitry Preobrazhensky
1eaf2d7b5a [AMDGPU][MC][DOC] Updated AMD GPU assembler description
See bug 36572: https://bugs.llvm.org/show_bug.cgi?id=36572

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

Reviewers: artem.tamazov, vpykhtin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327288 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12 15:55:08 +00:00
Puyan Lotfi
9e2cb4287d Updating MIR Language Reference to include new syntax for symbols and physregs.
External symbols now get the sigil '&' while physical registers get the sigil
'$' for their prefix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327276 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-12 14:51:19 +00:00
Sanjay Patel
8fca462512 [LangRef] make it clear that FP instructions do not have side effects
Also, fix the undef vs. UB example to use 'sdiv' because that can trigger div-by-zero UB.

The existing text for the constrained intrinsics says:
"By default, LLVM optimization passes assume that the rounding mode is round-to-nearest 
and that floating point exceptions will not be monitored. Constrained FP intrinsics are 
used to support non-default rounding modes and accurately preserve exception behavior 
without compromising LLVM’s ability to optimize FP code when the default behavior is 
used."
...so the additional text with the normal FP opcodes should make the different modes
clear.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327138 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09 15:27:48 +00:00
Nicolai Haehnle
d66fa2a670 TableGen: Add a defset statement
Allows capturing a list of concrete instantiated defs.

This can be combined with foreach to create parallel sets of def
instantiations with less repetition in the source. This purpose is
largely also served by multiclasses, but in some cases multiclasses
can't be used.

The motivating example for this change is having a large set of
intrinsics, which are generated from the IntrinsicsBackend.td file
included by Intrinsics.td, and a corresponding set of instruction
selection patterns, which are generated via the backend's .td files.

Multiclasses cannot be used to eliminate the redundancy in this case,
because a multiclass cannot span both LLVM's common .td files and
the backend .td files at the same time.

Change-Id: I879e35042dceea542a5e6776fad23c5e0e69e76b

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327121 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09 12:24:42 +00:00
Nicolai Haehnle
ad64c88991 TableGen: Allow arbitrary list values as ranges of foreach
The changes to FieldInit are required to make field references (Def.field)
work inside a ForeachDeclaration: previously, Def.field wasn't resolved
immediately when Def was already a fully resolved DefInit.

Change-Id: I9875baec2fc5aac8c2b249e45b9cf18c65ae699b

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327120 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09 12:24:30 +00:00
Nicolai Haehnle
a2472dbf17 TableGen: add !isa operation
Change-Id: Iddb724c3ae706d82933a2d82c91d07e0e36b30e3

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327117 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-09 12:24:06 +00:00
Ed Maste
828cfc4dba Use ellipsis ... to indicate omitted commands
In an example like "clang -fxray-instrument .." the .. could be confused
with a literal .. (parent directory), which is used in commands like
"cmake -GNinja .."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@327000 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 13:52:04 +00:00
Andrea Di Biagio
017ddc2762 Add llvm-mca.rst to the table of contents in docs/CommandGuide.
This should fix the documentation error reported by builder llvm-sphinx-docs
(build #16407) after r326998.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326999 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 13:43:11 +00:00
Andrea Di Biagio
29b29cc6a9 [llvm-mca] LLVM Machine Code Analyzer.
llvm-mca is an LLVM based performance analysis tool that can be used to
statically measure the performance of code, and to help triage potential
problems with target scheduling models.

llvm-mca uses information which is already available in LLVM (e.g. scheduling
models) to statically measure the performance of machine code in a specific cpu.
Performance is measured in terms of throughput as well as processor resource
consumption. The tool currently works for processors with an out-of-order
backend, for which there is a scheduling model available in LLVM.

The main goal of this tool is not just to predict the performance of the code
when run on the target, but also help with diagnosing potential performance
issues.

Given an assembly code sequence, llvm-mca estimates the IPC (instructions per
cycle), as well as hardware resources pressure. The analysis and reporting style
were mostly inspired by the IACA tool from Intel.

This patch is related to the RFC on llvm-dev visible at this link:
http://lists.llvm.org/pipermail/llvm-dev/2018-March/121490.html

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326998 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 13:05:02 +00:00
Jonas Devlieghere
e5edcce9f5 [dsymutil] Embed toolchain in dSYM bundle
Allow us to embed the (Xcode) toolchain in the dSYM bundle's property
list.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326994 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 10:39:12 +00:00
Tony Tye
636e2230de [AMDGPU] Update AMDGOUUsage.rst descriptions
- Improve description of XNACK ELF flag.
- Rename all uses of wave to wavefront to be consistent.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326989 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-08 05:46:01 +00:00
Sanjay Patel
81c70f8f4d [LangRef] fix formatting in FP descriptions; NFC
This is a clean-up step to reduce diffs ahead of real
changes to the FP semantics as discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2018-February/121444.html



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326913 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-07 17:18:22 +00:00
Nicolai Haehnle
8498a493c8 TableGen: Add !foldl operation
Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326790 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-06 13:49:16 +00:00
Nicolai Haehnle
a9e8c1d609 TableGen: Allow !cast of records, cleanup conversion machinery
Summary:
Distinguish two relationships between types: is-a and convertible-to.
For example, a bit is not an int or vice versa, but they can be
converted into each other (with range checks that you can think of
as "dynamic": unlike other type checks, those range checks do not
happen during parsing, but only once the final values have been
established).

Actually converting initializers between types is subtle: even
when values of type A can be converted to type B (e.g. int into
string), it may not be possible to do so with a concrete initializer
(e.g., a VarInit that refers to a variable of type int cannot
be immediately converted to a string).

For this reason, distinguish between getCastTo and convertInitializerTo:
the latter implements the actual conversion when appropriate, while
the former will first try to do the actual conversion and fall back
to introducing a !cast operation so that the conversion will be
delayed until variable references have been resolved.

To make the approach of adding !cast operations to work, !cast needs
to fallback to convertInitializerTo when the special string <-> record
logic does not apply.

This enables casting records to a subclass, although that new
functionality is only truly useful together with !isa, which will be
added in a later change.

The test is removed because it uses !srl on a bit sequence,
which cannot really be supported consistently, but luckily
isn't used anywhere either.

Change-Id: I98168bf52649176654ed2ec61a29bdb29970cfe7

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326785 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-06 13:48:39 +00:00
Nicolai Haehnle
d5cc0e077d TableGen: Reimplement !foreach using the resolving mechanism
Summary:
This changes the syntax of !foreach so that the first "parameter" is
a new syntactic variable: !foreach(x, lst, expr) will define the
variable x within the scope of expr, and evaluation of the !foreach
will substitute elements of the given list (or dag) for x in expr.

Aside from leading to a nicer syntax, this allows more complex
expressions where x is deeply nested, or even constant expressions
in which x does not occur at all.

!foreach is currently not actually used anywhere in trunk, but I
plan to use it in the AMDGPU backend. If out-of-tree targets are
using it, they can adjust to the new syntax very easily.

Change-Id: Ib966694d8ab6542279d6bc358b6f4d767945a805

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits, tpr

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326705 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-05 15:21:04 +00:00
Florian Hahn
de07406094 [Docs] Add LLVM for Grad Students to Contributing page.
Adrian Sampson's blog post provides a good and relatively up-do-date
introduction to LLVM. I think this post could be helpful for people wanting
to get started with LLVM.

Reviewers: asb, tonic, silvas, probinson, kristof.beyls, rengolin

Reviewed By: rengolin

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326576 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-02 14:35:02 +00:00
Martin Storsjo
8c77607fcb [AArch64] Add support for secrel add/load/store relocations for COFF
Differential Revision: https://reviews.llvm.org/D43288

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326480 91177308-0d34-0410-b5e6-96231b3b80d8
2018-03-01 20:42:28 +00:00
Saleem Abdulrasool
9b62265471 build: add the ability to create a symlink for dsymutil
Add a `LLVM_INSTALL_CCTOOLS_SYMLINKS` to mirror
`LLVM_INSTALL_BINUTILS_SYMLINKS`.  For now, this allows us to create
symlinks for `dsymutil` to `llvm-dsymutil`.  This option is off by
default, but the user can enable it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326381 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-28 23:00:50 +00:00
Scott Linder
5e4b515c4b [DebugInfo] Support DWARF v5 source code embedding extension
In DWARF v5 the Line Number Program Header is extensible, allowing values with
new content types. In this extension a content type is added,
DW_LNCT_LLVM_source, which contains the embedded source code of the file.

Add new optional attribute for !DIFile IR metadata called source which contains
source text. Use this to output the source to the DWARF line table of code
objects. Analogously extend METADATA_FILE in Bitcode and .file directive in ASM
to support optional source.

Teach llvm-dwarfdump and llvm-objdump about the new values. Update the output
format of llvm-dwarfdump to make room for the new attribute on file_names
entries, and support embedded sources for the -source option in llvm-objdump.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325970 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 23:01:06 +00:00
Hans Wennborg
54a2a8a3df Support for the mno-stack-arg-probe flag
Adds support for this flag. There is also another piece for clang
(separate review). More info:
https://bugs.llvm.org/show_bug.cgi?id=36221

By Ruslan Nikolaev!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325900 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 13:46:25 +00:00
Nicolai Haehnle
c34350228e TableGen: Add !size operation
Summary:
Returns the size of a list. I have found this to be rather useful in some
development for the AMDGPU backend where we could simplify our .td files
by concatenating list<LLVMType> for complex intrinsics. Doing so requires
us to compute the position argument for LLVMMatchType.

Basically, the usage is in a pattern that looks somewhat like this:

    list<LLVMType> argtypes =
        !listconcat(base,
                    [llvm_any_ty, LLVMMatchType<!size(base)>]);

Change-Id: I360a0b000fd488d18bea412228230fd93722bd2c

Reviewers: arsenm, craig.topper, tra, MartinO

Subscribers: wdng, llvm-commits, tpr

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325883 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-23 10:46:07 +00:00
Matt Morehouse
21ed2a6e29 [libFuzzer] Include TEMP_MAX_LEN in Fuzzer::PrintStats.
Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325817 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-22 19:00:17 +00:00
Dylan McKay
a78fde8559 Add default address space for functions to the data layout (1/3)
Summary:
This adds initial support for letting targets specify which address
spaces their functions should reside in by default.

If a function is created by a frontend, it will get the default address space specified in the DataLayout, unless the frontend explicitly uses a more general `llvm::Function` constructor. Function address spaces will become a part of the bitcode and textual IR forms, as we do not have access to a data layout whilst parsing LL.

It will be possible to write IR that explicitly has `addrspace(n)` on a function. In this case, the function will reside in the specified space, ignoring the default in the DL.

This is the first step towards placing functions into the correct
address space for Harvard architectures.

Full patchset
* Add program address space to data layout D37052
* Require address space to be specified when creating functions D37054
* [clang] Require address space to be specified when creating functions D37057

Reviewers: pcc, arsenm, kparzysz, hfinkel, theraven

Reviewed By: theraven

Subscribers: arichardson, simoncook, rengolin, wdng, uabelho, bjope, asb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325479 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-19 09:56:22 +00:00
Konstantin Zhuravlyov
16290892d3 AMDGPU: Bring elf flags in sync with the spec
- Add MACH flags
- Add XNACK flag
- Add reserved flags
- Minor cleanups in docs

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325399 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-16 22:33:59 +00:00
Pablo Barrio
5f393824ae [ARM] Allow 64- and 128-bit types with 't' inline asm constraint
Summary:
In LLVM, 't' selects a floating-point/SIMD register and only supports
32-bit values. This is appropriately documented in the LLVM Language
Reference Manual. However, this behaviour diverges from that of GCC, where
't' selects the s0-s31 registers and its qX and dX variants depending on
additional operand modifiers (q/P).

For example, the following C code:

#include <arm_neon.h>
float32x4_t a, b, x;
asm("vadd.f32 %0, %1, %2" : "=t" (x) : "t" (a), "t" (b))

results in the following assembly if compiled with GCC:

vadd.f32 s0, s0, s1

whereas LLVM will show "error: couldn't allocate output register for
constraint 't'", since a, b, x are 128-bit variables, not 32-bit.

This patch extends the use of 't' to mean that of GCC, thus allowing
selection of the lower Q vector regs and their D/S variants. For example,
the earlier code will now compile as:

vadd.f32 q0, q0, q1

This behaviour still differs from that of GCC but I think it is actually
more correct, since LLVM picks up the right register type based on the
datatype of x, while GCC would need an extra operand modifier to achieve
the same result, as follows:

asm("vadd.f32 %q0, %q1, %q2" : "=t" (x) : "t" (a), "t" (b))

Since this is only an extension of functionality, existing code should not
be affected by this change. Note that operand modifiers q/P are already
supported by LLVM, so this patch should suffice to support inline
assembly with constraint 't' originally built for GCC.

Reviewers: grosbach, rengolin

Reviewed By: rengolin

Subscribers: rogfer01, efriedma, olista01, aemerson, javed.absar, eraman, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325244 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-15 14:44:22 +00:00
Elena Demikhovsky
8e229ec0e5 Adding a width of the GEP index to the Data Layout.
Making a width of GEP Index, which is used for address calculation, to be one of the pointer properties in the Data Layout.
p[address space]:size:memory_size:alignment:pref_alignment:index_size_in_bits.
The index size parameter is optional, if not specified, it is equal to the pointer size.

Till now, the InstCombiner normalized GEPs and extended the Index operand to the pointer width.
It works fine if you can convert pointer to integer for address calculation and all registered targets do this.
But some ISAs have very restricted instruction set for the pointer calculation. During discussions were desided to retrieve information for GEP index from the Data Layout.
http://lists.llvm.org/pipermail/llvm-dev/2018-January/120416.html

I added an interface to the Data Layout and I changed the InstCombiner and some other passes to take the Index width into account.
This change does not affect any in-tree target. I added tests to cover data layouts with explicitly specified index size.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325102 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-14 06:58:08 +00:00
Yaxun Liu
2930e5c52d [AMDGPU] Change constant addr space to 4
Differential Revision: https://reviews.llvm.org/D43170


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@325030 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-13 18:00:25 +00:00
Matt Arsenault
6f2da0b6ad Reapply "AMDGPU: Add 32-bit constant address space"
This reverts r324494 and reapplies r324487.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324747 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-09 16:57:57 +00:00
Yaxun Liu
a43548c056 [AMDGPU] Updae documentation about address space
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324617 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 15:41:19 +00:00
Jonas Devlieghere
61693460a1 Re-land [dsymutil] Upstream update feature
This commit attempts to re-land the r324480 which was reverted in
r324493 because it broke the Windows bots. For now I disabled the two
update tests on Windows until I'm able to debug this.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324592 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-08 10:48:54 +00:00
Rafael Espindola
c952538085 Revert "AMDGPU: Add 32-bit constant address space"
This reverts commit r324487.

It broke clang tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324494 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 18:09:35 +00:00
Jonas Devlieghere
6bac809af9 Revert dsymutil -update commits
Revert "[dsymutil][test] Check the updated dSYM instead of companion file."
Revert "[dsymutil] Upstream update feature."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324493 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 17:35:27 +00:00
Marek Olsak
3afd566557 AMDGPU: Add 32-bit constant address space
Note: This is a candidate for LLVM 6.0, because it was planned to be
      in that release but was delayed due to a long review period.

Merge conflict in release_60 - resolution:
    Add "-p6:32:32" into the second (non-amdgiz) string.

Only scalar loads support 32-bit pointers. An address in a VGPR will
fail to compile. That's OK because the results of loads will only be used
in places where VGPRs are forbidden.

Updated AMDGPUAliasAnalysis and used SReg_64_XEXEC.
The tests cover all uses cases we need for Mesa.

Reviewers: arsenm, nhaehnle

Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324487 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 16:01:00 +00:00
Jonas Devlieghere
87dba15eee [dsymutil] Upstream update feature.
Now that dsymutil can generate accelerator tables, we can upstream the
update logic that, as the name implies, updates the accelerator tables
in an existing dSYM bundle. In combination with `-minimize` this can be
used to remove redundant .debug_(inlines|pubtypes|pubnames).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324480 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-07 13:51:29 +00:00
Lang Hames
a0fdd1603b [docs] Add out-of-date warnings to the BuildingAJIT tutorial text.
The text will be updated once the ORC API churn dies down.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324406 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-06 21:25:20 +00:00
Daniel Neilson
70622fa254 Add release note on change to memcpy/memmove/memset builtin signatures
Summary:
The signatures for the builtins @llvm.memcpy, @llvm.memmove, and @llvm.memset
where changed in rL322965. The number of arguments has decreased from five to
four with the removal of the alignment argument. Alignment is now conveyed
by supplying the align parameter attribute on the destination and/or source of
the cpy/move/set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324265 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-05 19:39:38 +00:00
David Blaikie
5ac13ad110 Coding Standards: Document library layering requirements & header isolation.
(I suppose these two pieces could be separated - but seemed related
enough)

As discussed on llvm-dev, this documents the general expectation of how
library layering should be handled. There are a few existing cases where
these constraints are not met, but as with most style guide things -
this is forward looking and provides guidance when cleaning up existing
code, it doesn't immediately require that all previous code be cleaned
up to match. (see: naming conventions, etc)

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324004 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-01 21:03:35 +00:00
Saleem Abdulrasool
77fc888bfe docs: wordsmith some of the linker option extension
Apply the grammatical improvements suggested by Rafael Avila de
Espindola in post-commit review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323839 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-31 00:16:23 +00:00
Tony Tye
90018a5eac [AMDGPU] Update relocation documentation and elf flag machine architecture numbers
Differential Revision: https://reviews.llvm.org/D42714


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323835 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 23:59:43 +00:00
Rui Ueyama
a0050c286c Rename path libpath in .linker-options.
"path" is too generic name for -L or --library-path because a lot of
linker options take paths as arguments. This change renames the option
to avoid confusion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323833 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 23:49:27 +00:00
Tony Tye
ae5d34e5ef [AMDGPU] Clarify ReqdWorkGroupSize and MaxFlatWorkGroupSize metadata
- If ReqdWorkGroupSize is present it must have all elements >=1.
- If MaxFlatWorkGroupSize must be consistent with ReqdWorkGroupSize.
- Remove FixedWorkGroupSize as now equivalent to ReqdWorkGroupSize.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323829 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 23:07:10 +00:00
Jonas Devlieghere
2fa8e76d04 [dsymutil] Enable -minimize feature.
Passing -minimize to dsymutil prevents the emission of .debug_inlines,
.debug_pubnames, and .debug_pubtypes in favor of the Apple accelerator
tables.

The actual check in the DWARF linker was added in r323655. This patch
simply enables it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323812 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 19:54:16 +00:00
Saleem Abdulrasool
e7676fec11 CodeGen: support an extension to pass linker options on ELF
Introduce an extension to support passing linker options to the linker.
These would be ignored by older linkers, but newer linkers which support
this feature would be able to process the linker.

Emit a special discarded section `.linker-option`.  The content of this
section is a pair of strings (key, value).  The key is a type identifier for
the parameter.  This allows for an argument free parameter that will be
processed by the linker with the value being the parameter.  As an example,
`lib` identifies a library to be linked against, traditionally the `-l`
argument for Unix-based linkers with the parameter being the library name.

Thanks to James Henderson, Cary Coutant, Rafael Espinolda, Sean Silva
for the valuable discussion on the design of this feature.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323783 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-30 16:29:29 +00:00
Hiroshi Inoue
d1b456b6d1 [NFC] fix trivial typos in comments and documents
"to to" -> "to"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323628 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-29 05:17:03 +00:00
Vedant Kumar
1b24b74c00 [LangRef] Update out-of-date instrprof names
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323575 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 23:54:25 +00:00
Matt Davis
3ae9ebfc0d [NFC] Remove apostrophe to use 'it' in the possessive form.
Summary: This is  a simple change to test commit access with.

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323544 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 18:43:57 +00:00
Hiroshi Inoue
8040eab589 [NFC] fix trivial typos in comments and documents
"in in" -> "in", "on on" -> "on" etc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323508 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-26 08:15:29 +00:00
Amjad Aboud
c6483fb873 Another try to commit 323321 (aggressive instruction combine).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323416 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-25 12:06:32 +00:00
Paul Robinson
e2f036e8e9 Fix up and document controlling ccache via CMake options.
Patch by Matthew Davis!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323357 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 18:15:08 +00:00
Amjad Aboud
39319e4065 Reverted 323321.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323326 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 14:48:49 +00:00
Amjad Aboud
594d89a614 [InstCombine] Introducing Aggressive Instruction Combine pass (-aggressive-instcombine).
Combine expression patterns to form expressions with fewer, simple instructions.
This pass does not modify the CFG.

For example, this pass reduce width of expressions post-dominated by TruncInst
into smaller width when applicable.

It differs from instcombine pass in that it contains pattern optimization that
requires higher complexity than the O(1), thus, it should run fewer times than
instcombine pass.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323321 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 12:42:42 +00:00
Sander de Smalen
52662527d7 Fixes Sphinx issue ('undefined label') introduced in r323313.
(and also slightly reformatted the related lines to look better in
the rendered HTML)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323317 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 10:30:23 +00:00
Sander de Smalen
959cee720d [Metadata] Extend 'count' field of DISubrange to take a metadata node
Summary:
This patch extends the DISubrange 'count' field to take either a
(signed) constant integer value or a reference to a DILocalVariable
or DIGlobalVariable.

This is patch [1/3] in a series to extend LLVM's DISubrange Metadata
node to support debugging of C99 variable length arrays and vectors with
runtime length like the Scalable Vector Extension for AArch64. It is
also a first step towards representing more complex cases like arrays
in Fortran.

Reviewers: echristo, pcc, aprantl, dexonsmith, clayborg, kristof.beyls, dblaikie

Reviewed By: aprantl

Subscribers: rnk, probinson, fhahn, aemerson, rengolin, JDevlieghere, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323313 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 09:56:07 +00:00
David Chisnall
e8a15e2fd6 [Doc] Guideline on adding exception handling support for a target
Summary:
This is the first attempt to write down a guideline on adding exception handling support for a target. The content basically bases on the discussion on [1]. If you guys know who is exception handling expert, please add him as the reviewer. Thanks.

[1] http://lists.llvm.org/pipermail/llvm-dev/2018-January/120405.html

Reviewers: t.p.northover, theraven, nemanjai

Reviewed By: theraven

Subscribers: sdardis, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323311 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-24 09:53:01 +00:00
Vedant Kumar
bfc9a5a17e docs: Remove reference to a deprecated flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323254 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-23 20:22:37 +00:00
Daniel Neilson
4f82436e1d Additional fixes for docs in addition to r322968.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322969 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 17:32:33 +00:00
Daniel Neilson
f445ab028c Fix docs build break caused by r322965
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322968 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 17:24:21 +00:00
Daniel Neilson
afa2e7e6a6 Remove alignment argument from memcpy/memmove/memset in favour of alignment attributes (Step 1)
Summary:
 This is a resurrection of work first proposed and discussed in Aug 2015:
   http://lists.llvm.org/pipermail/llvm-dev/2015-August/089384.html
and initially landed (but then backed out) in Nov 2015:
   http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

 The @llvm.memcpy/memmove/memset intrinsics currently have an explicit argument
which is required to be a constant integer. It represents the alignment of the
dest (and source), and so must be the minimum of the actual alignment of the
two.

 This change is the first in a series that allows source and dest to each
have their own alignments by using the alignment attribute on their arguments.

 In this change we:
1) Remove the alignment argument.
2) Add alignment attributes to the source & dest arguments. We, temporarily,
   require that the alignments for source & dest be equal.

 For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 100, i32 4, i1 false)
will now read
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %dest, i8* align 4 %src, i32 100, i1 false)

 Downstream users may have to update their lit tests that check for
@llvm.memcpy/memmove/memset call/declaration patterns. The following extended sed script
may help with updating the majority of your tests, but it does not catch all possible
patterns so some manual checking and updating will be required.

s~declare void @llvm\.mem(set|cpy|move)\.p([^(]*)\((.*), i32, i1\)~declare void @llvm.mem\1.p\2(\3, i1)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* \3, i8 \4, i8 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* \3, i8 \4, i16 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* \3, i8 \4, i32 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* \3, i8 \4, i64 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* \3, i8 \4, i128 \5, i1 \6)~g
s~call void @llvm\.memset\.p([^(]*)i8\(i8([^*]*)\* (.*), i8 (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i8(i8\2* align \6 \3, i8 \4, i8 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i16\(i8([^*]*)\* (.*), i8 (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i16(i8\2* align \6 \3, i8 \4, i16 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i32\(i8([^*]*)\* (.*), i8 (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i32(i8\2* align \6 \3, i8 \4, i32 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i64\(i8([^*]*)\* (.*), i8 (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i64(i8\2* align \6 \3, i8 \4, i64 \5, i1 \7)~g
s~call void @llvm\.memset\.p([^(]*)i128\(i8([^*]*)\* (.*), i8 (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.memset.p\1i128(i8\2* align \6 \3, i8 \4, i128 \5, i1 \7)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* \4, i8\5* \6, i8 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* \4, i8\5* \6, i16 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* \4, i8\5* \6, i32 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* \4, i8\5* \6, i64 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 [01], i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* \4, i8\5* \6, i128 \7, i1 \8)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i8\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i8 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i8(i8\3* align \8 \4, i8\5* align \8 \6, i8 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i16\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i16 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i16(i8\3* align \8 \4, i8\5* align \8 \6, i16 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i32\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i32 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i32(i8\3* align \8 \4, i8\5* align \8 \6, i32 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i64\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i64 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i64(i8\3* align \8 \4, i8\5* align \8 \6, i64 \7, i1 \9)~g
s~call void @llvm\.mem(cpy|move)\.p([^(]*)i128\(i8([^*]*)\* (.*), i8([^*]*)\* (.*), i128 (.*), i32 ([0-9]*), i1 ([^)]*)\)~call void @llvm.mem\1.p\2i128(i8\3* align \8 \4, i8\5* align \8 \6, i128 \7, i1 \9)~g

 The remaining changes in the series will:
Step 2) Expand the IRBuilder API to allow creation of memcpy/memmove with differing
   source and dest alignments.
Step 3) Update Clang to use the new IRBuilder API.
Step 4) Update Polly to use the new IRBuilder API.
Step 5) Update LLVM passes that create memcpy/memmove calls to use the new IRBuilder API,
        and those that use use MemIntrinsicInst::[get|set]Alignment() to use
        getDestAlignment() and getSourceAlignment() instead.
Step 6) Remove the single-alignment IRBuilder API for memcpy/memmove, and the
        MemIntrinsicInst::[get|set]Alignment() methods.

Reviewers: pete, hfinkel, lhames, reames, bollu

Reviewed By: reames

Subscribers: niosHD, reames, jholewinski, qcolombet, jfb, sanjoy, arsenm, dschuff, dylanmckay, mehdi_amini, sdardis, nemanjai, david2050, nhaehnle, javed.absar, sbc100, jgravelle-google, eraman, aheejin, kbarton, JDevlieghere, asb, rbar, johnrusso, simoncook, jordy.potman.lists, apazos, sabuasal, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322965 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-19 17:13:12 +00:00
Joel Jones
a317810bb4 [docs] Make ReleaseProcess.rst 80 column. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322849 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-18 14:57:55 +00:00
Florian Hahn
d330940802 [LangRef] Clarify Varargs forwarding for musttail calls.
This clarification was suggested by @efriedma in D41335, which uses this
behavior to inline musttail calls with varargs.

Reviewers: hfinkel, efriedma, rnk

Reviewed By: rnk

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322786 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17 23:29:25 +00:00
Sean Eveson
a470b46d80 [MC] Fix -stack-size-section on ARM
Change symbol values in the stack_size section from being 8 bytes, to being a target dependent size.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322619 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-17 09:01:29 +00:00
Hiroshi Inoue
f90f551998 [NFC] fix trivial typos in documents
"the the" -> "the"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322552 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-16 13:19:48 +00:00
Brian Gesiak
5006689534 [docs] Only LLVM IR bitstreams begin with 'BC'
Summary:
The LLVM Bitcode File Format documentation states that all bitstreams
begin with the magic number 'BC', and that generic bitstream analyzer
tools may check for this number in order to determine whether the
stream is a bitstream.

However, in practice:

* Only LLVM IR bitcode begins with 'BC'. Other bitstreams -- Clang
  AST files and precompiled headers, Clang serialized diagnostics,
  Swift modules -- do not start with 'BC'. A tool that actually checked
  for 'BC' would only be able to recognize LLVM IR.
* The `llvm-bcanalyzer`, arguably the most used generic bitstream
  analyzer tool, does not check for a magic number 'BC' (except to
  determine whether the file is LLVM IR).

Update the bitcode format documentation to make it clear that not all
bitstreams begin with 'BC', and that tools should not rely on that
particular magic number value.

Test Plan:
Build the `docs-llvm-html` target and confirm the changes render in
a Safari web browser.

Reviewers: harlanhaskins, eugenis, mehdi_amini, pcc, angerman

Reviewed By: angerman

Subscribers: angerman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322520 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-15 21:23:32 +00:00
Jan Korous
94cb0130bc [docs] Fix mention of GCC frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322491 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-15 17:11:22 +00:00
Zachary Turner
0b5677cbf8 Update MSF File Documentation.
This adds some more detail about the PDB container format,
specifically surrounding the layout of the Free Page Map.

Patch by Colden Cullen
Differential Revision: https://reviews.llvm.org/D41825

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322404 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-12 21:42:39 +00:00
Ben Hamilton
379dc2786e [docs] Tweak update to Phabricator docs about setting repository for diffs uploaded via web
Summary:
In D41919, I missed that there was a *second* step when uploading
diffs via web where the repository should be specified.

Reviewers: asb, probinson

Reviewed By: asb

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322375 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-12 15:44:35 +00:00
Ben Hamilton
5b07bb01a0 [docs] Update Phabricator docs about setting repository for diffs uploaded via web
Summary:
Docs are out of date now that we have separate repositories for LLVM,
Clang, etc.

Reviewers: asb

Reviewed By: asb

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322290 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-11 16:30:08 +00:00
Francis Visoiu Mistrih
1f2edf66a2 [MIR] Update MIRLangRef with documentation on bundled instructions
Differential Revision: https://reviews.llvm.org/D41872

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322198 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-10 17:53:16 +00:00
Sam Clegg
e92250ac8f [WebAssembly] Add COMDAT support
This adds COMDAT support to the Wasm object-file format.
Spec: https://github.com/WebAssembly/tool-conventions/pull/31

Corresponding LLD change:
https://bugs.llvm.org/show_bug.cgi?id=35533, and D40845

Patch by Nicholas Wilson

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322135 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 23:43:14 +00:00
Francis Visoiu Mistrih
4e1cf66e6f [MIR] Add support for the frame-destroy MachineInstr flag
We are printing / parsing the `frame-setup` MachineInstr flag but not
the `frame-destroy` one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322071 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-09 11:33:22 +00:00
Tim Hammerquist
4cbfbada4d remove unreferenced footnotes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321840 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 00:24:55 +00:00
Tim Hammerquist
4967d786bb fix invalid footnote syntax
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321839 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-05 00:24:54 +00:00
Max Moroz
fc04e85715 [llvm-cov] Refactor "export" command implementation and add support for SOURCES.
Summary: Define an interface for Exporter + split JSON exporter into .h and .cpp.

Reviewers: vsk, morehouse

Reviewed By: vsk

Subscribers: llvm-commits, Dor1s, kcc

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321815 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 19:33:29 +00:00
Kostya Kortchinsky
014bd602e9 [docs] Update Scudo documentation
Summary:
The documentation has fallen a bit behind, update it with the latest evolution
of the allocator:
- clarify a couple of expectations regarding what is meant to be achieved;
- update the header format;
- document `-fsanitize=scudo`.

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321811 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 18:31:22 +00:00
Florian Hahn
98977edb88 [Docs] Add Contributing page.
This new page acts as an entry point for (new) contributors to LLVM and
provides information about

* What to contribute
* How to submit a patch
* Where to start to learn more about LLVM's architecture and internals.

This version of the page duplicates some information from the
DeveloperPolicy and Phabricator pages. Subsequent changes should work
towards moving information for new developers to this page, where it
makes sense.

Reviewers: reames, probinson, kristof.beyls, silvas, rengolin, asb

Reviewed By: silvas

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321804 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-04 17:12:21 +00:00
Hans Wennborg
e3f54bd3f0 Clear release notes for 7.0.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321727 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 15:45:32 +00:00
Hans Wennborg
e28b7aabcf The trunk version is now 7.0.0svn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321712 91177308-0d34-0410-b5e6-96231b3b80d8
2018-01-03 14:52:54 +00:00
Jonas Devlieghere
8dbab12eeb [docs] Use dbgs() instead of errs() for DEBUG()
The examples in llvm/Support/Debug.h use `DEBUG(dbgs() << ...)` instead
of `errs()`, so the examples in the Programmer's Manual should match
that.

Patch by: Moritz Sichert <moritz.sichert@googlemail.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-25 14:16:07 +00:00
David Blaikie
86e7a0583d PR35705: Fix Chapter 9 example code for API changes to DIBuilder
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20 19:36:54 +00:00
Martin Storsjo
c8f103e52b [AArch64] Implement stack probing for windows
Differential Revision: https://reviews.llvm.org/D41131

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321150 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-20 06:51:45 +00:00
Francis Visoiu Mistrih
234b36e423 [CodeGen] Move printing MO_IntrinsicID operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321112 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19 21:47:10 +00:00
Francis Visoiu Mistrih
43c2ba74fc [CodeGen] Move printing MO_IntrinsicID operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

Also add support for printing with a null TargetIntrinsicInfo and no
MachineFunction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321111 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19 21:47:05 +00:00
Francis Visoiu Mistrih
fcfc7b225f [CodeGen] Move printing MO_CFIIndex operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

Before this patch we printed "<call frame instruction>" in the debug
output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@321084 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-19 16:51:52 +00:00
Francis Visoiu Mistrih
65ad22d969 [YAML] Add support for non-printable characters
LLVM IR function names which disable mangling start with '\01'
(https://www.llvm.org/docs/LangRef.html#identifiers).

When an identifier like "\01@abc@" gets dumped to MIR, it is quoted, but
only with single quotes.

http://www.yaml.org/spec/1.2/spec.html#id2770814:

"The allowed character range explicitly excludes the C0 control block
allowed), the surrogate block #xD800-#xDFFF, #xFFFE, and #xFFFF."

http://www.yaml.org/spec/1.2/spec.html#id2776092:

"All non-printable characters must be escaped.
[...]
Note that escape sequences are only interpreted in double-quoted scalars."

This patch adds support for printing escaped non-printable characters
between double quotes if needed.

Should also fix PR31743.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320996 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-18 17:38:03 +00:00
Francis Visoiu Mistrih
ee30ab7184 [CodeGen] Print MCSymbol operands as <mcsymbol sym> in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`<mcsymbol sym>` instead of `<MCSym=sym>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320685 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:03:23 +00:00
Francis Visoiu Mistrih
d398775f54 [CodeGen] Print external symbols as $symbol in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`$symbol` instead of `<es:symbol>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320681 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-14 10:02:58 +00:00
Francis Visoiu Mistrih
d347e9783d [CodeGen] Print jump-table index operands as %jump-table.0 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `%jump-table.0` instead of `<jt#0>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320566 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:59 +00:00
Francis Visoiu Mistrih
2b16863067 [CodeGen] Print target index operands as target-index(target-specific) + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing `target-index(target-specific) + 8` instead of `<ti#0+8>` and `target-index(target-specific) + 8` instead of `<ti#0-8>`.

Only debug syntax is affected.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320565 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:51 +00:00
Francis Visoiu Mistrih
c84690975a [CodeGen] Print constant pool index operands as %const.0 + 8 in both MIR and debug output
Work towards the unification of MIR and debug output by printing
`%const.0 + 8` instead of `<cp#0+8>` and `%const.0 - 8` instead of
`<cp#0-8>`.

Only debug syntax is affected.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320564 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 10:30:45 +00:00
Dean Michael Berris
69956ecc21 [XRay][compiler-rt] Reduce XRay log spam
This change makes XRay print the log file output only when the verbosity
level is higher than 0. It reduces the log spam in the default case when
we want XRay running silently, except when there are actual
fatal/serious errors.

We also update the documentation to show how to get the information
after the change to the default behaviour.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320550 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-13 06:37:13 +00:00
Geoff Berry
3b391fe80e [MachineOperand][MIR] Add isRenamable to MachineOperand.
Summary:
Add isRenamable() predicate to MachineOperand.  This predicate can be
used by machine passes after register allocation to determine whether it
is safe to rename a given register operand.  Register operands that
aren't marked as renamable may be required to be assigned their current
register to satisfy constraints that are not captured by the machine
IR (e.g. ABI or ISA constraints).

Reviewers: qcolombet, MatzeB, hfinkel

Subscribers: nemanjai, mcrosier, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320503 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 17:53:59 +00:00
Tony Tye
9d223a1998 [AMDGPU] Rename Bonaire target to be gfx704; remove gfx800 and make Iceland and Tonga both use gfx802; update target feature handling
Correct committed version to match intended accepted review D40051 id=123417

- Rename Bonaire target to be gfx704.
- Eliminate gfx800 and make Iceland and Tonga both use gfx802 as they use the same code.
- List target features supported by each processor in the processor table together with the default value.
- Add xnack flag to e_flags.
- Remove xnack from kernel metadata and kernel descriptor since it is now a whole code object property.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-12 05:47:00 +00:00
Max Moroz
d4b0ab066f [llvm-cov] Add an option for "export" command to emit only file summary data.
Summary:
That allows to get the same data as produced by "llvm-cov report",
but in JSON format, which is better for further processing by end users.

Reviewers: vsk

Reviewed By: vsk

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320435 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 23:17:46 +00:00
Tony Tye
c865d8aba4 [AMDGPU] Rename Bonaire target to be gfx704; update target feature handling
- Rename Bonaire target to be gfx704.
- Eliminate gfx800 and make Iceland and Tonga both use gfx802 as they use the same code.
- List target features supported by each processor in the processor table together with the default value.
- Add xnack flag to e_flags.
- Remove xnack from kernel metadata and kernel descriptor since it is now a whole code object property.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320378 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-11 15:35:27 +00:00
Craig Topper
bbc0301b61 [Docs] Fix typo in scheduler model documentation. enumemation->enumeration
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-10 09:14:35 +00:00
Adrian Prantl
012e6e52d4 Remove duplicate option from documentation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09 19:09:59 +00:00
Evgeniy Stepanov
d47b5b3974 Hardware-assisted AddressSanitizer (llvm part).
Summary:
This is LLVM instrumentation for the new HWASan tool. It is basically
a stripped down copy of ASan at this point, w/o stack or global
support. Instrumenation adds a global constructor + runtime callbacks
for every load and store.

HWASan comes with its own IR attribute.

A brief design document can be found in
clang/docs/HardwareAssistedAddressSanitizerDesign.rst (submitted earlier).

Reviewers: kcc, pcc, alekseyshl

Subscribers: srhines, mehdi_amini, mgorny, javed.absar, eraman, llvm-commits, hiraditya

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320217 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-09 00:21:41 +00:00
Adrian Prantl
b5b768dede dwarfdump: Add support for the --diff option.
--diff      Emit the output in a diff-friendly way by omitting offsets and
            addresses.

<rdar://problem/34502625>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320214 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 23:32:47 +00:00
Francis Visoiu Mistrih
e28484a720 [CodeGen] Move printing MO_Immediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

Add support for operand subreg index as an immediate to debug printing
and use ::print in the MIRPrinter.

Differential Review: https://reviews.llvm.org/D40965

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320209 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 22:53:21 +00:00
Vedant Kumar
2cac108e97 [Debugify] Add a pass to test debug info preservation
The Debugify pass synthesizes debug info for IR. It's paired with a
CheckDebugify pass which determines how much of the original debug info
is preserved. These passes make it easier to create targeted tests for
debug info preservation.

Here is the Debugify algorithm:

  NextLine = 1
  for (Instruction &I : M)
    attach DebugLoc(NextLine++) to I

  NextVar = 1
  for (Instruction &I : M)
    if (canAttachDebugValue(I))
      attach dbg.value(NextVar++) to I

The CheckDebugify pass expects contiguous ranges of DILocations and
DILocalVariables. If it fails to find all of the expected debug info, it
prints a specific error to stderr which can be FileChecked.

This was discussed on llvm-dev in the thread:
"Passes to add/validate synthetic debug info"

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320202 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 21:57:28 +00:00
Francis Visoiu Mistrih
ab9bb80575 [CodeGen] Move printing MO_CImmediate operands to MachineOperand::print
Work towards the unification of MIR and debug output by refactoring the
interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320140 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-08 11:40:06 +00:00
Mark Searles
f534f4a24f [AMDGPU] Fix typo in Kernel Descriptor for GFX6-GFX9
Differential Revision: https://reviews.llvm.org/D40981

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320087 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 21:24:27 +00:00
Evgeniy Stepanov
6463d1106b Update BitCodeFormat.
Add 2 recently added attributes to list of well-known attributes
in BitCodeFormat.rst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319999 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-07 01:38:20 +00:00
Dean Michael Berris
f5f5294ad8 [XRay][docs] Document xray_mode and log registration API.
This marks certain flags in XRay as deprecated (in particular,
`xray_naive_log=` and `xray_fdr_log=`), and recommends the use of the
`xray_mode=` flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319763 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 12:43:12 +00:00
Francis Visoiu Mistrih
ca0df55065 [CodeGen] Unify MBB reference format in both MIR and debug output
As part of the unification of the debug format and the MIR format, print
MBB references as '%bb.5'.

The MIR printer prints the IR name of a MBB only for block definitions.

* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)->getNumber\(\)/" << printMBBReference(*\1)/g'
* find . \( -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#" << ([a-zA-Z0-9_]+)\.getNumber\(\)/" << printMBBReference(\1)/g'
* find . \( -name "*.txt" -o -name "*.s" -o -name "*.mir" -o -name "*.cpp" -o -name "*.h" -o -name "*.ll" \) -type f -print0 | xargs -0 sed -i '' -E 's/BB#([0-9]+)/%bb.\1/g'
* grep -nr 'BB#' and fix

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319665 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-04 17:18:51 +00:00
Kostya Serebryany
1fe1bd128c [libFuzzer] add a flag -malloc_limit_mb
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319590 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-01 22:12:04 +00:00
Hans Wennborg
2a6c2bd504 docs/GettingStarted.rst: Update the list of release versions and tags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319502 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 23:47:30 +00:00
Sanjay Patel
f7047551dd [LangRef] clarify semantics of the frem instruction
As noted in D40594, the frem instruction corresponds to fmod() except that it can't set errno.
I modified the text that we currently use for intrinsics that map to libm functions and applied
it to frem.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319437 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 14:59:03 +00:00
Sean Eveson
ab494c9385 [MC] Function stack size section.
Re applying after fixing issues in the diff, sorry for any painful conflicts/merges!

Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html

This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128).

The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary.

There is a follow up change to add an option to clang.

Thanks.

Reviewers: hfinkel, MatzeB

Reviewed By: MatzeB

Subscribers: thegameg, asb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319430 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 13:05:14 +00:00
Sean Eveson
360f53a441 Revert r319423: [MC] Function stack size section.
I messed up the diff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319429 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:43:25 +00:00
Sean Eveson
5e536b7694 [MC] Function stack size section.
Summary:
Original RFC: http://lists.llvm.org/pipermail/llvm-dev/2017-August/117028.html

I wasn't sure who to put as reviewers, so please add/remove people as appropriate.

This change adds a '.stack-size' section containing metadata on function stack sizes to output ELF files behind the new -stack-size-section flag. The section contains pairs of function symbol references (8 byte) and stack sizes (unsigned LEB128).

The contents of this section can be used to measure changes to stack sizes between different versions of the compiler or a source base. The advantage of having a section is that we can extract this information when examining binaries that we didn't build, and it allows users and tools easy access to that information just by referencing the binary.

There is a follow up change to add an option to clang.

Thanks.

Reviewers: hfinkel, MatzeB

Reviewed By: MatzeB

Subscribers: thegameg, asb, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319423 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 12:01:16 +00:00
Dean Michael Berris
fe376dcd53 [XRay][docs] Update documentation on new default for xray_naive_log=
We've recently changed the default for `xray_naive_log=` to be `false`
instead of `true` to make it more consistent with the FDR mode logging
implementation. This means we will now ask users to explicitly choose
which version of the XRay logging is being used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319400 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 05:35:51 +00:00
Kostya Serebryany
eb4cb7ad5c [libFuzzer] mention one more trophie in the Linux Kernel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319397 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-30 02:26:47 +00:00
Konstantin Zhuravlyov
a9edc75bfd AMDGPU: Add num spilled s/vgprs to metadata
This was requested by tools.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319192 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-28 17:51:08 +00:00
Daniel Sanders
6d9a2314a0 Add release note about TargetRegistry change from r318352
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319093 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27 21:12:55 +00:00
Fangrui Song
c66b9564b9 [XRay] Fix typo in docs. NFC
Reviewers: dberris

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319047 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-27 16:59:26 +00:00
Gil Rapaport
a36486e33b [LV] Model masking in VPlan, introducing VPInstructions
This patch adds a new abstraction layer to VPlan and leverages it to model the planned
instructions that manipulate masks (AND, OR, NOT), introduced during predication.

The new VPValue and VPUser classes model how data flows into, through and out
of a VPlan, forming the vertices of a planned Def-Use graph. The new
VPInstruction class is a generic single-instruction Recipe that models a
planned instruction along with its opcode, operands and users. See
VectorizationPlan.rst for more details.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318645 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-20 12:01:47 +00:00
Zhen Cao
fc1a0ac68e [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

This is the second attempt to commit this. The test was broken on Linux in the first attempt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 21:59:43 +00:00
Rafael Espindola
1e4e74feed Revert "[MC] Fix regression tests on Windows when git “core.autocrlf” is set to true."
This reverts commit r318528.

MC/AsmParser/preserve-comments-crlf.s fails on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318533 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 17:31:20 +00:00
Zhen Cao
e66112a7be [MC] Fix regression tests on Windows when git “core.autocrlf” is set to true.
Differential Revision: https://reviews.llvm.org/D39737

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318528 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-17 16:17:56 +00:00
Kostya Serebryany
549203e435 [libFuzzer] add docs for -reduce_inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318439 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 18:58:14 +00:00
Yaxun Liu
35ad126c78 Let llvm.invariant.group.barrier accepts pointer to any address space
llvm.invariant.group.barrier may accept pointers to arbitrary address space.

This patch let it accept pointers to i8 in any address space and returns
pointer to i8 in the same address space.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318413 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-16 16:32:16 +00:00
Vedant Kumar
5e1ec5bede [docs] Mention opt -metarenamer in the bugpoint docs
Thanks to arsenm and davide for the suggestion!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 18:05:19 +00:00
Vedant Kumar
4aef6b8206 [docs] Document a way to simplify names in bugpoint output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318257 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-15 02:58:45 +00:00
Hans Wennborg
138434e367 Update some code.google.com links
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@318115 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-13 23:47:58 +00:00
Tony Tye
995388dd36 [AMDGPU] Correct targets that support XNACK
Differential Revision: https://reviews.llvm.org/D39887


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317955 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-11 00:50:32 +00:00
Tony Tye
2f2cb6b2a2 [AMDGPU] AMDGPUUsage.rst minor corrections
Differential Revision: https://reviews.llvm.org/D39887


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317924 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 20:51:43 +00:00
Igor Laevsky
089f886ad9 [llvm-opt-fuzzer] Introduce llvm-opt-fuzzer for fuzzing optimization passes
This change adds generic fuzzing tools capable of running libFuzzer tests on
any optimization pass or combination of them.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317883 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 12:19:08 +00:00
Tony Tye
9000e8c60d [AMDGPU] Update code object description
- Use ELF header flags to identify processor.
 - Remove isa note record.
 - Add target feature section.
 - Make metadata for NumVGPRs, NumSGPRs and MaxFlatWorkGroupSize required.
 - Add FixedWorkGroupSize to CodeProps metadata.
 - Add ReqdWorkGroupSize* to kernel descriptor and move MaxFlatWorkGroupSize to be adjacent.
 - Move IsXNACKEnabled in the kernel descriptor to be at the end of the unused flags.
 - Remove IsDynamicCallStack from the metadata and kernel descriptor.
 - Remove legacy debugger metadata.
 - Remove old XNACK enabled processor names.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317855 91177308-0d34-0410-b5e6-96231b3b80d8
2017-11-10 01:00:54 +00:00