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

6305 Commits

Author SHA1 Message Date
Lang Hames
1c1b097d52 [Docs] Fix another typo in the Error/Expected docs.
llvm-svn: 280461
2016-09-02 03:50:50 +00:00
Lang Hames
0f68dae0fe [Docs] Fix a couple of typos in the Error/Expected docs.
llvm-svn: 280460
2016-09-02 03:46:08 +00:00
Chandler Carruth
6f18fb32db 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.

llvm-svn: 280419
2016-09-01 22:18:25 +00:00
Chris Bieneman
6bb874314b [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.

llvm-svn: 280380
2016-09-01 16:43:39 +00:00
Geoff Berry
a8b176e84c [LangRef] Clarify !invariant.load semantics.
Based on discussion on llvm-dev.

llvm-svn: 280262
2016-08-31 17:39:21 +00:00
Aaron Ballman
8c41c02304 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)
llvm-svn: 280247
2016-08-31 14:37:20 +00:00
Aaron Ballman
e01bfd6d5e 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)
llvm-svn: 280238
2016-08-31 13:29:23 +00:00
Peter Zotov
5732e2dc8b 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.

llvm-svn: 280071
2016-08-30 10:48:31 +00:00
Chris Bieneman
616b6eef0d [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".

llvm-svn: 280013
2016-08-29 21:26:32 +00:00
Gor Nishanov
cc3ff9c81d [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

llvm-svn: 279971
2016-08-29 14:34:12 +00:00
Sylvestre Ledru
ea722a5808 Fix some typos in the doc
llvm-svn: 279943
2016-08-28 20:29:18 +00:00
Andrew Kaylor
c215eadb51 Adding document describing the use of the -opt-bisect-limit option.
llvm-svn: 279881
2016-08-26 23:11:48 +00:00
Kostya Serebryany
25e0e96b53 [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
llvm-svn: 279787
2016-08-25 22:35:08 +00:00
Kostya Serebryany
3418266527 [libFuzzer] fix link in docs
llvm-svn: 279589
2016-08-23 23:43:08 +00:00
Kostya Serebryany
711f079c2c [libFuzzer] docs on value profile
llvm-svn: 279587
2016-08-23 23:36:21 +00:00
Zachary Turner
c9ffc82e08 Update coding standards for include style.
Reviewed By: lattner
Differential Revision: https://reviews.llvm.org/D23591

llvm-svn: 279560
2016-08-23 20:07:32 +00:00
Peter Zotov
40de94a24e [CMake] [OCaml] Add -DLLVM_ENABLE_OCAMLDOC switch
Patch by Michael Gorny.

llvm-svn: 279544
2016-08-23 18:07:16 +00:00
Jacques Pienaar
ba3a117c71 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

llvm-svn: 279169
2016-08-18 22:10:06 +00:00
Jacques Pienaar
c0f5d90c11 [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

llvm-svn: 279149
2016-08-18 21:25:17 +00:00
George Burgess IV
21ab1f4274 [Docs] More MemorySSA doc updates!
Thanks again to Michael Kuperstein for the feedback.

llvm-svn: 279032
2016-08-18 02:56:05 +00:00
George Burgess IV
72f29279b9 [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.

llvm-svn: 279007
2016-08-17 23:21:56 +00:00
Chris Lattner
97a3fdb26d wordsmith the "new targets" section a bit.
llvm-svn: 278994
2016-08-17 22:17:03 +00:00
Renato Golin
fa602b9d53 [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.

llvm-svn: 278971
2016-08-17 20:38:09 +00:00
Andrey Bokhanko
584f261fc5 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

llvm-svn: 278932
2016-08-17 14:53:18 +00:00
George Burgess IV
e3f10cb9c1 [Docs] Fix post-review comments on MemorySSA's docs.
Thanks to Sean Silva for bringing these up. :)

llvm-svn: 278885
2016-08-17 01:50:54 +00:00
George Burgess IV
ed6145085d [Docs] Add initial MemorySSA documentation.
Patch partially by Danny.

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

llvm-svn: 278875
2016-08-17 00:17:29 +00:00
Mehdi Amini
f448ca43f7 Revert "Revert "Invariant start/end intrinsics overloaded for address space""
This reverts commit 32fc6488e48eafc0ca1bac1bd9cbf0008224d530.

llvm-svn: 278609
2016-08-13 23:31:24 +00:00
Mehdi Amini
2c3de3e169 Revert "Invariant start/end intrinsics overloaded for address space"
This reverts commit r276447.

llvm-svn: 278608
2016-08-13 23:27:32 +00:00
Kostya Serebryany
953a732708 [libFuzzer] mention one more trophie in LLVM
llvm-svn: 278582
2016-08-13 00:12:32 +00:00
Kostya Serebryany
c140ece1e5 [libFuzzer] fix typo in docs
llvm-svn: 278563
2016-08-12 20:42:24 +00:00
Gor Nishanov
37bbef4980 [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

llvm-svn: 278481
2016-08-12 05:45:49 +00:00
Sanjoy Das
fd2f817482 [LangRef] Fix formatting (no semantic change)
llvm-svn: 278294
2016-08-10 21:48:24 +00:00
Gor Nishanov
04cd924e8d [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

llvm-svn: 278242
2016-08-10 16:40:39 +00:00
Kostya Serebryany
43b11203fd [scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332
llvm-svn: 278180
2016-08-09 23:57:04 +00:00
Charles Davis
2ca27b7279 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.

llvm-svn: 278053
2016-08-08 21:20:15 +00:00
Charles Davis
24439f8d33 [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

llvm-svn: 278048
2016-08-08 21:01:39 +00:00
Lang Hames
19b2c052e6 [BuildingAJIT] Fix a couple of typos in the Chapter 3 draft.
llvm-svn: 278033
2016-08-08 18:09:56 +00:00
Gor Nishanov
728fb88de4 testing commit access
llvm-svn: 277816
2016-08-05 13:17:06 +00:00
Vedant Kumar
b3c987ea6f [llvm-cov] Add some documentation for the -tab-size option
Also, un-hide the cl::opt.

llvm-svn: 277741
2016-08-04 18:00:42 +00:00
Kostya Serebryany
a9a5306a06 [sanitizer] Implement a __asan_default_options() equivalent for Scudo
Summary:
Currently, the Scudo Hardened Allocator only gets its flags via the SCUDO_OPTIONS environment variable.
With this patch, we offer the opportunity for programs to define their own options via __scudo_default_options() which behaves like __asan_default_options() (weak symbol).
A relevant test has been added as well, and the documentation updated accordingly.
I also used this patch as an opportunity to rename a few variables to comply with the LLVM naming scheme, and replaced a use of Report with dieWithMessage for consistency (and to avoid a callback).

Reviewers: llvm-commits, kcc

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

llvm-svn: 277536
2016-08-02 22:25:38 +00:00
Lang Hames
9a3ce89b6d [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.
This patch replaces RuntimeDyld::SymbolInfo with JITSymbol: A symbol class
that is capable of lazy materialization (i.e. the symbol definition needn't be
emitted until the address is requested). This can be used to support common
and weak symbols in the JIT (though this is not implemented in this patch).

For consistency, RuntimeDyld::SymbolResolver is renamed to JITSymbolResolver.

For space efficiency a new class, JITEvaluatedSymbol, is introduced that
behaves like the old RuntimeDyld::SymbolInfo - i.e. it is just a pair of an
address and symbol flags. Instances of JITEvaluatedSymbol can be used in
symbol-tables to avoid paying the space cost of the materializer.

llvm-svn: 277386
2016-08-01 20:49:11 +00:00
Sanjoy Das
76a6f34a7e [IR] Introduce a non-integral pointer type
Summary:
This change adds a `ni` specifier in the `datalayout` string to denote
pointers in some given address spaces as "non-integral", and adds some
typing rules around these special pointers.

Reviewers: majnemer, chandlerc, atrick, dberlin, eli.friedman, tstellarAMD, arsenm

Subscribers: arsenm, mcrosier, llvm-commits

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

llvm-svn: 277085
2016-07-28 23:43:38 +00:00
David Majnemer
618a29cbe1 [coroutines] Part 3 of N: Adding Boilerplate for Coroutine Passes
This adds boilerplate code for all coroutine passes,
the passes are no-ops for now.
Also, a small test has been added to verify that passes execute in
the expected order or not at all if coroutine support is disabled.

Patch by Gor Nishanov!

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

llvm-svn: 277033
2016-07-28 21:04:31 +00:00
Renato Golin
333fbe947a [docs] Add sub-mod example by Chris to GitHub proposal
llvm-svn: 277032
2016-07-28 20:57:25 +00:00
Sylvestre Ledru
01ce646378 fix some typos in the doc
llvm-svn: 276968
2016-07-28 09:28:58 +00:00
Daniel Sanders
59970a0b88 [mips] Update the link to the MIPS documentation in CompilerWriterInfo.rst.
llvm-svn: 276850
2016-07-27 08:52:15 +00:00
Mehdi Amini
d740e150df Fix Coroutines doc example
SSA was broken.

llvm-svn: 276843
2016-07-27 06:03:47 +00:00
David Majnemer
466bebafa0 [coroutines] Part 2 of N: Adding Coroutine Intrinsics
This is the second patch in the coroutine series. It adds coroutine
intrinsics and updates intrinsic cost in TargetTransformInfoImpl.h.

Patch by Gor Nishanov!

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

llvm-svn: 276839
2016-07-27 05:12:35 +00:00
Vedant Kumar
ecbcac0311 [docs] Fix a sphinx error in llvm-cov.rst
Failing bot:

  http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/12025

Fix tested with `ninja docs-llvm-html`.

llvm-svn: 276820
2016-07-26 23:09:57 +00:00
Vedant Kumar
e22de321ce Retry: [llvm-cov] Add support for exporting coverage data to JSON
This enables users to export coverage information as portable JSON for use by
analysis tools and storage in document based databases.

The export sub-command is invoked just like the others:

  llvm-cov export -instr-profile path/to/foo.profdata path/to/foo.binary

The resulting JSON contains a list of files and functions. Every file object
contains a list of segments, expansions, and a summary of the file's region,
function, and line coverage. Every function object contains the function's name
and regions. There is also a total summary for the entire object file.

Changes since the initial commit (r276813):

  - Fixed the regexes in the tests to handle Windows filepaths.

Patch by Eddie Hurtig!

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

llvm-svn: 276818
2016-07-26 22:50:58 +00:00