Commit Graph

257 Commits

Author SHA1 Message Date
Davide Italiano
6a92b76991 [Docs] Fix a broken link in the Kaleidoscope tutorial.
Patch by:	Alfred Perlstein <alfred@FreeBSD.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-13 06:31:37 +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
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
Lang Hames
075c1e2e1a [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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277386 91177308-0d34-0410-b5e6-96231b3b80d8
2016-08-01 20:49:11 +00:00
Lang Hames
5a04b09d43 [Kaleidoscope][BuildingAJIT] More work on the text for Chapter 3.
Add an overview of stubs and compile callbacks before the discussion of the
source changes.

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

M    docs/tutorial/BuildingAJIT3.rst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275933 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-19 00:25:52 +00:00
Alexander Kornienko
46f9c274d1 Fixed errors in docs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275789 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 14:13:18 +00:00
Lang Hames
8e1c20f813 [Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275518 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-15 01:39:49 +00:00
Sylvestre Ledru
e0f2f6011e fix some various typos in the doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 19:28:40 +00:00
Wilfred Hughes
f9c643b6e0 New Kaleidoscope chapter: Creating object files
This new chapter describes compiling LLVM IR to object files.

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

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274441 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-02 17:01:59 +00:00
Lang Hames
6c2d562b4c [Kaleidoscope][BuildingAJIT] Remove some superfluous commas in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 18:37:52 +00:00
Lang Hames
4cf102de04 [Kaleidoscope][BuildingAJIT] Fix a punctuation mistake in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@273183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-20 18:34:46 +00:00
David Majnemer
0c4f69f653 Remove the ScalarReplAggregates pass
Nearly all the changes to this pass have been done while maintaining and
updating other parts of LLVM.  LLVM has had another pass, SROA, which
has superseded ScalarReplAggregates for quite some time.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272737 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-15 00:19:09 +00:00
Hans Wennborg
e09bd44a40 Fix some typos in the Kaleidoscope tutorial (PR28120)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272681 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-14 16:05:12 +00:00
Lang Hames
8abe734181 [Kaleidoscope] Update Chapter 3 of the "Implementing a Language" tutorial to
take into account modernizations in r246002 and r270381.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271985 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-07 05:40:08 +00:00
Lang Hames
eaf5ddfe77 [Kaleidoscope][BuildingAJIT] Fix hyphenation in chapter 2 title.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271924 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:35:44 +00:00
Lang Hames
5d3458a04a [Kaleidoscope][BuildingAJIT] More cleanup of Chapter 2.
Streamline some wording, fix a bug in the markup for the layer interface table.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:22:47 +00:00
Lang Hames
bae1eaf5d8 [Kaleidoscope][BuildingAJIT] Clean up sentence, remove comments from code block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 18:07:23 +00:00
Lang Hames
30bfbc3566 [Kaleidoscope][BuildingAJIT] Split up the code-block describing the substitution
of OptimizeLayer for CompileLayer in Chapter 2.

Hopefully this will read a little more clearly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 05:07:52 +00:00
Lang Hames
01157841a3 [Kaleidoscope][BuildingAJIT] Fix code-blocks in Chapter 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271867 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 04:53:59 +00:00
Lang Hames
608095db1c [Kaleidoscope][BuildingAJIT] Add tutorial text for Chapter 2.
This chapter discusses IR optimizations, the ORC IRTransformLayer, and the ORC
layer concept itself.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271865 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-06 03:28:12 +00:00
Lang Hames
1fa1983597 [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.
This tidies up some code that was manually constructing RuntimeDyld::SymbolInfo
instances from JITSymbols. It will save more mess in the future when
JITSymbol::getAddress is extended to return an Expected<TargetAddress> rather
than just a TargetAddress, since we'll be able to embed the error checking in
the conversion.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-31 23:14:26 +00:00
Lang Hames
9dd9c9cfcb [Kaleidoscope][BuildingAJIT] Finish off Chapter 1.
* Various tidy-up and streamlining of existing discussion.
* Describes findSymbol and removeModule.

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

Feedback, patches etc. very welcome.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 19:03:26 +00:00
Lang Hames
f43e7e48eb [Kaleidoscope][BuildingAJIT] Add stub Chapter 5 text.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-30 16:53:19 +00:00
Lang Hames
7ac928f303 [Kaleidoscope][BuildingAJIT] Add stub chapter text for Building A JIT Chapter 4.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271064 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-27 22:34:56 +00:00
Lang Hames
26ec8e8a3d [Kaleidoscope][BuildingAJIT] Fix strong emphasis markup by removing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:21:18 +00:00
Lang Hames
71d351f50d [Kaleidoscope][BuildingAJIT] Add docs for Chapter 3 of the Building A JIT
tutorial.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 21:17:06 +00:00
Lang Hames
df5dfe2a2e [Kaleidoscope][BuildingAJIT] Add a stub Chapter 2 doc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270809 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 00:38:04 +00:00
Lang Hames
630552d242 [KaleidoscopeJIT][BuildingAJIT] Remove some copy-pasta from Chapter 1.
This text was accidentally left in when the original document was copied from
Chapter 7 of the Kaleidoscope language series.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270799 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:42:48 +00:00
Lang Hames
bdbb8ee4ab [Kaleidoscope][BuildingAJIT] Shorten the name of the BuildingAJIT tutorial
series.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270796 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 23:34:19 +00:00
Lang Hames
e48344195f [Kaleidoscope][BuildingAJIT] Fix code-block indents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:33:25 +00:00
Lang Hames
ba9118ae86 [Kaleidoscope][BuildingAJIT] Add a description of the KaleidoscopeJIT addModule
method to Chapter1 of the BuildingAJIT tutorial.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270778 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-25 22:27:25 +00:00
Lang Hames
5d82919adc [Kaleidoscope] Add an initial "Building an ORC JIT" tutorial chapter.
This is a work in progress - the chapter text is incomplete, though
the example code compiles and runs.

Feedback and patches are, as usual, most welcome.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270487 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-23 20:34:19 +00:00
Mehdi Amini
8be7707c14 Remove every uses of getGlobalContext() in LLVM (but the C API)
At the same time, fixes InstructionsTest::CastInst unittest: yes
you can leave the IR in an invalid state and exit when you don't
destroy the context (like the global one), no longer now.

This is the first part of http://reviews.llvm.org/D19094

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-14 21:59:01 +00:00
Lang Hames
215b61f08e [Kaleidoscope] Rename Error -> LogError in Chapters 2-5.
This keeps the naming consistent with Chapters 6-8, where Error was renamed to
LogError in r264426 to avoid clashes with the new Error class in libSupport.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264427 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:41:26 +00:00
Lang Hames
d7b240afb9 [Kaleidoscope] Fix 'Error' name clashes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264426 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-25 17:33:32 +00:00
Wilfred Hughes
0a1bf1d197 Remove obselete reference to TypeResolve from the tutorial.
TypeResolve went away in r134829 in 2011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263702 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:20:58 +00:00
Wilfred Hughes
656df231ed Minor grammar fix in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263700 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 10:18:13 +00:00
Wilfred Hughes
c2e48fb33a Further typo fixes in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263697 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 09:26:45 +00:00
Wilfred Hughes
a66f9eb55e Fix typo in kaleidoscope tutorial.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@263696 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17 09:09:07 +00:00
Sylvestre Ledru
3c5ec72fb6 Fix some typos in the llvm doc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@260855 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-14 20:16:22 +00:00
Alex Denisov
022b1097ba LLVM tutorial: fix broken links/anchors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255671 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 20:50:29 +00:00
Alex Denisov
fd671c136f [Docs] Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@253167 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-15 14:13:24 +00:00
Peter Collingbourne
2c641c0a8f Update tutorial for debug info IR change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@252226 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-05 22:55:44 +00:00
Lang Hames
8c46d7964e Recommit r246175 - Add Kaleidoscope regression tests, with a fix to make sure
the kaleidoscope 'library' functions aren't dead-stripped in release builds.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246201 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 20:31:44 +00:00
Lang Hames
38941a6a20 Revert r246175 to get builder green again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246185 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:54:41 +00:00
Lang Hames
b325a1ace5 Add Kaleidoscope regression tests.
These will be run if LLVM_BUILD_EXAMPLES is enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246175 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-27 18:13:34 +00:00
Lang Hames
548643ecda [Kaleidoscope] Fix a typo in Chapter 5.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246081 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26 20:57:03 +00:00
Lang Hames
28388315a9 Big Kaleidoscope tutorial update.
This commit switches the underlying JIT for the Kaleidoscope tutorials from
MCJIT to a custom ORC-based JIT, KaleidoscopeJIT. This fixes a lot of the bugs
in Kaleidoscope that were introduced when we deleted the legacy JIT. The
documentation for Chapter 4, which introduces the JIT APIs, is updated to
reflect the change.

Also included are a number of C++11 modernizations and general cleanup. Where
appropriate, the docs have been updated to reflect these changes too.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246002 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-26 03:07:41 +00:00
Lang Hames
1356c7901a [Kaleidoscope] More inter-chapter diff reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245474 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-19 18:32:58 +00:00
Lang Hames
44364a33be [Kaleidoscope] Clang-format the Kaleidoscope tutorials.
Also reduces changes between tutorial chapters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245472 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-19 18:15:58 +00:00