Commit Graph

6317 Commits

Author SHA1 Message Date
Kostya Serebryany
05e1dea79e [libFuzzer] remove use_traces=1 since use_value_profile seems to be strictly better
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-09 01:17:03 +00:00
Kostya Serebryany
10c8c3c91f [libFuzzer] add missing docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280996 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 22:21:13 +00:00
Reid Kleckner
88e07a9d10 Remove restriction that 'sret' must be on the first parameter
On Windows, it is often applied to the second parameter, and the x86
backend is prepared to deal with sret appearing on any parameter.

Other backends assume it only appears on parameter zero, but those are
target-specific requirements, and not an IR-level rule.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280951 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-08 15:45:27 +00:00
Justin Lebar
f0bb43fb8e [CUDA] Rework "optimizations" and "publication" section in CompileCudaWithLLVM.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280869 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 21:46:53 +00:00
Justin Lebar
667609507f [CUDA] Clarify that -l and -L only need to be passed when linking, in CompileCudaWithLLVM.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 21:46:49 +00:00
Justin Lebar
70425af25f [CUDA] Further reformat "invoking clang" section of CompileCudaWithLLVM.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 21:46:21 +00:00
Justin Lebar
5b033da95a [CUDA] Fix typo in link in CompileCudaWithLLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280859 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:42:24 +00:00
Justin Lebar
e61b182c68 [CUDA] Move AXPY example into gist.
No need to have a long inline code snippet in this doc.

Also move "flags that control numerical code" underneath the "invoking
clang" section, and reformat things a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:37:41 +00:00
Justin Lebar
f1708bca49 [CUDA] Simplify build/install instructions in CompileCudaWithLLVM.rst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280850 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:09:53 +00:00
Justin Lebar
188c78b94e [CUDA] Call it "CUDA", not "CUDA C/C++" in our docs.
CUDA is an extension to C++ -- there is no such thing as "CUDA C".  But
also, the language is much more commonly called "CUDA" than "CUDA C++".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:09:50 +00:00
Justin Lebar
78e95faf4b [CUDA] Expand upon --cuda-gpu-arch flag in CompileCudaWithLLVM doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280848 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-07 20:09:46 +00:00
Andrey Bokhanko
0c18303d8a Fixed a typo (LLVM/Support/CFG.h -> LLVM/IR/CFG.h)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 11:13:35 +00:00
Lang Hames
08f7f18b9f [Docs] Fix another typo in the Error/Expected docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 03:50:50 +00:00
Lang Hames
8ebfd86577 [Docs] Fix a couple of typos in the Error/Expected docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-02 03:46:08 +00:00
Chandler Carruth
2c8b23f86f Make the coding standards a bit more clear that we prefer the fancy new
auto-brief format for doxygen comments. Most notable is switching to
that in the example doxygen comment. I've also tweaked the wording but
am happy to tweak it further if others have suggestions here.

Mostly doing this to capture something I and others have been writing
consistently and repeatedly in code reviews.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280419 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 22:18:25 +00:00
Chris Bieneman
51d3515b04 [CMake] Revive LLVM_*_DIRS variables
This is a partial revert of r280013. Brad King pointed out these variable names are matching CMake conventions, so we should preserve them.

I've also added a direct mapping of the LLVM_*_DIR variables which we need to make projects support building in and out of tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-01 16:43:39 +00:00
Geoff Berry
eb8a4ab881 [LangRef] Clarify !invariant.load semantics.
Based on discussion on llvm-dev.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 17:39:21 +00:00
Aaron Ballman
da4a9a639e Changing a code block to text because Sphinx does not like it on the builder (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12517/steps/docs-llvm-html/logs/stdio)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 14:37:20 +00:00
Aaron Ballman
1012af3602 Changing a code block to text because Sphinx does not like it on the builder (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12516/steps/docs-llvm-html/logs/stdio)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-31 13:29:23 +00:00
Peter Zotov
eaff23d7dc docs: mention that clobbering output regs in inline asm is illegal.
I've found this out the hard way; LLVM will not normally catch this
error (unless -verify-machineinstrs is passed), and under certain
very specific circumstances (such as register scavenger running
under pressure) this would result in an opaque crash in codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280071 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-30 10:48:31 +00:00
Chris Bieneman
684477bf40 [CMake] Make LLVMConfig.cmake variable names match in-tree names
With the runtimes build we're trying to use LLVMConfig.cmake as a way of providing LLVM_* variables that are needed to behave as if the project is building in tree. To make this work we need to rename two variables by dropping the "S" from the end. This makes the variables match the in-tree names.

This renames:
LLVM_INCLUDE_DIRS -> LLVM_INCLUDE_DIR
LLVM_LIBRARY_DIRS -> LLVM_LIBRARY_DIR

The versions ending in S are not used in-tree anywhere. This also cleans up LLVM_LIBRARY_DIR being set to the same value with and without the "S".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280013 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 21:26:32 +00:00
Gor Nishanov
bce16c69f0 [Coroutines] Part 9: Add cleanup subfunction.
Summary:
[Coroutines] Part 9: Add cleanup subfunction.

This patch completes coroutine heap allocation elision. Now, the heap elision example from docs\Coroutines.rst compiles and produces expected result (see test/Transform/Coroutines/ex3.ll)

Intrinsic Changes:
* coro.free gets a token parameter tying it to coro.id to allow reliably discovering all coro.frees associated with a particular coroutine.
* coro.id gets an extra parameter that points back to a coroutine function. This allows to check whether a coro.id describes the enclosing function or it belongs to a different function that was later inlined.

CoroSplit now creates three subfunctions:
# f$resume - resume logic
# f$destroy - cleanup logic, followed by a deallocation code
# f$cleanup - just the cleanup code

CoroElide pass during devirtualization replaces coro.destroy with either f$destroy or f$cleanup depending whether heap elision is performed or not.

Other fixes, improvements:
* Fixed buglet in Shape::buildFrame that was not creating coro.save properly if coroutine has more than one suspend point.

* Switched to using variable width suspend index field (no longer limited to 32 bit index field can be as little as i1 or as large as i<whatever-size_t-is>)

Reviewers: majnemer

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-29 14:34:12 +00:00
Sylvestre Ledru
297f179ffa Fix some typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279943 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-28 20:29:18 +00:00
Andrew Kaylor
bc94acefe6 Adding document describing the use of the -opt-bisect-limit option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-26 23:11:48 +00:00
Kostya Serebryany
7750b380af [libFizzer] rename -print_new_cov_pcs=1 into -print_pcs=1 and make it more useful: print PCs only after the initial corpus has been read and symbolize them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279787 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-25 22:35:08 +00:00
Kostya Serebryany
5c091363f7 [libFuzzer] fix link in docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279589 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 23:43:08 +00:00
Kostya Serebryany
94041883a5 [libFuzzer] docs on value profile
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279587 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 23:36:21 +00:00
Zachary Turner
f99445facd Update coding standards for include style.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D23591

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279560 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 20:07:32 +00:00
Peter Zotov
29a5291c40 [CMake] [OCaml] Add -DLLVM_ENABLE_OCAMLDOC switch
Patch by Michael Gorny.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-23 18:07:16 +00:00
Jacques Pienaar
e4c3ea0900 Fix link quotes on AArch64's CompilerWriterInfo section.
Reviewers: t.p.northover

Subscribers: t.p.northover, aemerson, rengolin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279169 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 22:10:06 +00:00
Jacques Pienaar
56ae20aeb9 [lanai] Add ISA document to CompilerWritersInfo
Summary: Add Lanai ISA document to CompilerWritersInfo.

Reviewers: eliben

Subscribers: aemerson, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279149 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 21:25:17 +00:00
George Burgess IV
11eaa16dfe [Docs] More MemorySSA doc updates!
Thanks again to Michael Kuperstein for the feedback.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279032 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-18 02:56:05 +00:00
George Burgess IV
7c34aef00d [Docs] Update MemorySSA doc to address more feedback.
Primarily, this clarifies wording in a few places, and adds "\ "s to
make the formatting of things like "``Foo`` s" better.

Thanks to Michael Kuperstein for the comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279007 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 23:21:56 +00:00
Chris Lattner
915cd42ee3 wordsmith the "new targets" section a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 22:17:03 +00:00
Renato Golin
302f15fa35 [docs] Adding "new target" rules to dev policy
Making explicit our current policy to accept new targets as experimental and
later official. Every new target should follow these rules to be added,
and kept relevant in the upstream tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278971 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 20:38:09 +00:00
Andrey Bokhanko
e708f8d798 Clarify the statement on using #if 0 ... #endif in CodingStandards.
The statement on using #if 0 ... #endif is not very clear (for people like me
:-)). This patch clarifies it a bit to avoid confusion.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278932 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 14:53:18 +00:00
George Burgess IV
c49441293b [Docs] Fix post-review comments on MemorySSA's docs.
Thanks to Sean Silva for bringing these up. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278885 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 01:50:54 +00:00
George Burgess IV
6058abac58 [Docs] Add initial MemorySSA documentation.
Patch partially by Danny.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-17 00:17:29 +00:00
Mehdi Amini
804c815e77 Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278609 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:31:24 +00:00
Mehdi Amini
2eb84a568a Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276447.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278608 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 23:27:32 +00:00
Kostya Serebryany
afcd0577ed [libFuzzer] mention one more trophie in LLVM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278582 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-13 00:12:32 +00:00
Kostya Serebryany
45edca1acf [libFuzzer] fix typo in docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278563 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 20:42:24 +00:00
Gor Nishanov
b6ae34d909 [Coroutines]: Part6b: Add coro.id intrinsic.
Summary:
1. Make coroutine representation more robust against optimization that may duplicate instruction by introducing coro.id intrinsics that returns a token that will get fed into coro.alloc and coro.begin. Due to coro.id returning a token, it won't get duplicated and can be used as reliable indicator of coroutine identify when a particular coroutine call gets inlined.
2. Move last three arguments of coro.begin into coro.id as they will be shared if coro.begin will get duplicated.
3. doc + test + code updated to support the new intrinsic.

Reviewers: mehdi_amini, majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-12 05:45:49 +00:00
Sanjoy Das
be91a8ec03 [LangRef] Fix formatting (no semantic change)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 21:48:24 +00:00
Gor Nishanov
bd0032e1a2 [Coroutines] Part 6: Elide dynamic allocation of a coroutine frame when possible
Summary:
A particular coroutine usage pattern, where a coroutine is created, manipulated and
destroyed by the same calling function, is common for coroutines implementing
RAII idiom and is suitable for allocation elision optimization which avoid
dynamic allocation by storing the coroutine frame as a static `alloca` in its
caller.

coro.free and coro.alloc intrinsics are used to indicate which code needs to be suppressed
when dynamic allocation elision happens:
```
entry:
  %elide = call i8* @llvm.coro.alloc()
  %need.dyn.alloc = icmp ne i8* %elide, null
  br i1 %need.dyn.alloc, label %coro.begin, label %dyn.alloc
dyn.alloc:
  %alloc = call i8* @CustomAlloc(i32 4)
  br label %coro.begin
coro.begin:
  %phi = phi i8* [ %elide, %entry ], [ %alloc, %dyn.alloc ]
  %hdl = call i8* @llvm.coro.begin(i8* %phi, i32 0, i8* null,
                          i8* bitcast ([2 x void (%f.frame*)*]* @f.resumers to i8*))
```
and
```
  %mem = call i8* @llvm.coro.free(i8* %hdl)
  %need.dyn.free = icmp ne i8* %mem, null
  br i1 %need.dyn.free, label %dyn.free, label %if.end
dyn.free:
  call void @CustomFree(i8* %mem)
  br label %if.end
if.end:
  ...
```

If heap allocation elision is performed, we replace coro.alloc with a static alloca on the caller frame and coro.free with null constant.

Also, we need to make sure that if there are any tail calls referencing the coroutine frame, we need to remote tail call attribute, since now coroutine frame lives on the stack.

Documentation and overview is here: http://llvm.org/docs/Coroutines.html.

Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
3.Add empty coroutine passes. (https://reviews.llvm.org/D22847)
4.Add coroutine devirtualization + tests.
ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
c) Do devirtualization (https://reviews.llvm.org/D23229)
5.Add CGSCC restart trigger + tests. (https://reviews.llvm.org/D23234)
6.Add coroutine heap elision + tests.  <= we are here
7.Add the rest of the logic (split into more patches)

Reviewers: mehdi_amini, majnemer

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-10 16:40:39 +00:00
Kostya Serebryany
1e3f45d363 [scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-09 23:57:04 +00:00
Charles Davis
d77fdcbf64 Revert "[X86] Support the "ms-hotpatch" attribute."
This reverts commit r278048. Something changed between the last time I
built this--it takes awhile on my ridiculously slow and ancient
computer--and now that broke this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 21:20:15 +00:00
Charles Davis
cedd288a90 [X86] Support the "ms-hotpatch" attribute.
Summary:
Based on two patches by Michael Mueller.

This is a target attribute that causes a function marked with it to be
emitted as "hotpatchable". This particular mechanism was originally
devised by Microsoft for patching their binaries (which they are
constantly updating to stay ahead of crackers, script kiddies, and other
ne'er-do-wells on the Internet), but is now commonly abused by Windows
programs to hook API functions.

This mechanism is target-specific. For x86, a two-byte no-op instruction
is emitted at the function's entry point; the entry point must be
immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding.
This padding is where the patch code is written. The two byte no-op is
then overwritten with a short jump into this code. The no-op is usually
a `movl %edi, %edi` instruction; this is used as a magic value
indicating that this is a hotpatchable function.

Reviewers: majnemer, sanjoy, rnk

Subscribers: dberris, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278048 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 21:01:39 +00:00
Lang Hames
32217d6ae4 [BuildingAJIT] Fix a couple of typos in the Chapter 3 draft.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278033 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-08 18:09:56 +00:00
Gor Nishanov
ebdd31d1d6 testing commit access
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-05 13:17:06 +00:00