344 Commits

Author SHA1 Message Date
Dinu Blanovschi
9c9157b256
Fix typo in LangImpl03.rst (#127389) 2025-02-17 12:11:36 +00:00
FantasqueX
14776c6d13
[Kaleidoscope] Fix typo (#125366)
Remove duplicate word.
2025-02-01 23:33:43 +00:00
AidinT
6f8a363a48
[Kaleidoscope] Add mem2reg pass to function pass manager (#119707)
Kaleidoscope has switched to new pass manager before (#72324), but both
code and tutorial document have some missing parts.

This pull request fixes the following problems:
1. Adds `PromotePass` to the function pass manager. This pass was
removed during the switch from legacy pass manager to the new pass
manager.
2. Syncs the tutorial with the code.
2024-12-12 16:25:09 +01:00
AidinT
8df6637e84
[doc] Fix Kaleidoscope tutorial chapter 3 code snippet and full listing discrepancies (#111289)
Fix two discrepancies between the cited snippets and the full code.
2024-10-07 12:43:27 +02:00
Stephen Tozer
400d4fd7b6
[RemoveDIs] Update all docs to use debug records (#91768)
As we approach the state where support for debug intrinsics is dropping and
we print and use debug records by default, the documentation should be updated
to refer to debug records as the primary debug info representation, with
debug intrinsics being relegated to an optional alternative.

This patch performs a few updates:
- Replace references to intrinsics with references to records across all
the documentation.
- Replace intrinsics with records in code examples.
- Move debug records prior to debug intrinsics in the
SourceLevelDebugging document, and change text to refer to them as the
primary representation.
- Add release notes describing the change.
2024-06-11 14:16:32 +01:00
Gonsolo
33aaad9427
[Kaleidoscope] LLVM is not needed for chapter two (#69823)
Since the example (llvm/examples/Kaleidoscope/Chapter2/toy.cpp) is
self-contained there is no need to use LLVM.
2024-01-12 20:48:43 -08:00
Hana Dusíková
dad614cc60
[Documentation] fix invalid links in documentation (#76502) 2024-01-09 08:00:20 +01:00
youkaichao
eea217681d
[Doc] update the usage of opt with mem2reg pass in tutorial (#76282)
The current command will raise an error:

> The `opt -passname` syntax for the new pass manager is not supported,
please use `opt -passes=<pipeline>` (or the `-p` alias for a more
concise version).

Update the usage now.
2023-12-24 20:11:27 +08:00
Fangrui Song
114325b86a Kaleidoscope-Ch8: use Reloc::PIC_
which has better portability across different OSes.
In addition, on many ELF OSes, this output relocatable file can be
linked without -no-pie.
2023-12-05 23:44:35 -08:00
Logikable
3d2527ebe3
[Kaleidoscope] Switch to the new PassManager, revisited. (#72324)
Rollforward of #69032, which was reverted in
[63d19cf](63d19cfd85).

New: implemented changes in
https://github.com/llvm/llvm-project/pull/69032#issuecomment-1809250162.
Given the PassBuilder is how we expect users to register passes, the
tutorial should reflect that.
2023-11-16 09:13:56 -08:00
Amara Emerson
63d19cfd85 Revert "[Kaleidoscope] Switch to the new PassManager. (#69032)"
This reverts commit 7b94744e77aaf752abc2c6ab38ee3fdfafbeff9d.

This breaks the expensive checks bot: https://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/26026/

We didn't notice because it was broken for other reasons I think.
2023-11-13 14:38:14 -08:00
Logikable
7b94744e77
[Kaleidoscope] Switch to the new PassManager. (#69032)
Using the new pass manager is more verbose; let me know if the tutorial
doesn't flow well with all the additions.
2023-10-18 09:25:50 -07:00
Arthur Eubanks
0a1aa6cda2
[NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes (#66295)
This will make it easy for callers to see issues with and fix up calls
to createTargetMachine after a future change to the params of
TargetMachine.

This matches other nearby enums.

For downstream users, this should be a fairly straightforward
replacement,
e.g. s/CodeGenOpt::Aggressive/CodeGenOptLevel::Aggressive
or s/CGFT_/CodeGenFileType::
2023-09-14 14:10:14 -07:00
Mike Rostecki
2addaeda18 [docs] Use ExecutorAddr::toPtr() in ORC documentation.
The partial move from JITTargetAddress to ExecutorAddr in 8b1771bd9f30 did not
update the ORC or Kaleidoscope documents. This patch fixes the inconsistency.

Reviewed By: lhames

Differential Revision: https://reviews.llvm.org/D150458
2023-05-31 15:15:55 -07:00
Lang Hames
8b1771bd9f [ORC] Move most ORC APIs to ExecutorAddr, introduce ExecutorSymbolDef.
ExecutorAddr was introduced in b8e5f918166 as an eventual replacement for
JITTargetAddress. ExecutorSymbolDef is introduced in this patch as a
replacement for JITEvaluatedSymbol: ExecutorSymbolDef is an (ExecutorAddr,
JITSymbolFlags) pair, where JITEvaluatedSymbol was a (JITTargetAddress,
JITSymbolFlags) pair.

A number of APIs had already migrated from JITTargetAddress to ExecutorAddr,
but many of ORC's internals were still using the older type. This patch aims
to address that.

Some public APIs are affected as well. If you need to migrate your APIs you can
use the following operations:

* ExecutorAddr::toPtr replaces jitTargetAddressToPointer and
  jitTargetAddressToFunction.

* ExecutorAddr::fromPtr replace pointerToJITTargetAddress.

* ExecutorAddr(JITTargetAddress) creates an ExecutorAddr value from a
  JITTargetAddress.

* ExecutorAddr::getValue() creates a JITTargetAddress value from an
  ExecutorAddr.

JITTargetAddress and JITEvaluatedSymbol will remain in JITSymbol.h for now, but
the aim will be to eventually deprecate and remove these types (probably when
MCJIT and RuntimeDyld are deprecated).
2023-03-27 17:37:58 -07:00
Dhruv Chawla
1625530d76 [Kaleidoscope] Update code snippets in text to match full code listings
There were quite a few places in the tutorial where the snippets were not up to date with the full code listings given. I have updated all of the ones I could find, which mostly involves changing `.` to `->` when accessing through a `std::unique_ptr`, changing `while (1)` to `while (true)`, and other such small changes.

There are still however a few places where I am not sure what to do, such as:
- Chapter 4: `ParseTopLevelExpr()` in chapter 3 sets the ProtoTypeAST
             name to "", however it is referred to as "__anon_expr"
             in chapter 4. Would it be required to mention this change
             in chapter 4?
- Chapter 9: The code snippets refer to the top level expression as
             "main", however the full code listing refers to it as
             "__anon_expr". I think given the context of the chapter
             it makes sense to refer to it as "main", so I have
             updated the code listing to reflect that.
- Chapter 9: In chapter 9 the diff given for `HandleTopLevelExpression()`
             deletes code that is not mentioned anywhere else, so I am
             not sure what is to be done there.
- Miscellaneous: I don't think this is very important, however the
                 casing used for the first word of error messages
                 tends to vary between upper and lower case between
                 chapters and I do not know if it is worth reconciling
                 these differences.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D142323
2023-01-31 23:31:02 +05:30
Vasileios Porpodas
12c55eb66d [docs] Update docs since getBasicBlockList() is now private
Differential Revision: https://reviews.llvm.org/D140163
2022-12-15 21:41:24 -08:00
Shivam Gupta
fdc950958e Added warning about outdated feature into Kaleidoscope tutorial text
**Motivation: **  I have been studying LLVM with LLVM Kaleidoscope tutorial. In the 4th part I faced an error which said that I can't redefine a function as shown in the tutorial. After hours of searching, I finally found the reason that produced the error is that the feature of symbols redefinition has been disabled since LLVM-9. There was no information about that in the tutorial's text, so I've decided to add a warning.

**Changes**: The only file I fixed is "`llvm/docs/tutorial/MyFirstLanguageFrontend/LangImpl04.rst`", I added text warning which says that described feature is outdated and the described functionality will not work properly on LLVM versions older 8 one.

Patch by : DKay7

Differential Revision: https://reviews.llvm.org/D130613
2022-08-07 14:37:05 +05:30
Justin Brooks
fb95b8dc35 [Kaleidoscope] Fix DWARF function creation example
The full code listing was fixed in fdaeb0c647eb66763721a7fe74e0a36b007dcd75

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D130217
2022-07-25 18:19:59 +00:00
Marc Auberer
972fe43133 [Kaleidoscope] Remove unused function argument
Removes an unused function argument from a code listing in the Kaleidoscope turorial in step 9.

Reviewed By: dblaikie, MaskRay

Differential Revision: https://reviews.llvm.org/D128628
2022-06-30 20:47:01 +00:00
Roman Sokolkov
153431ec7a [docs] Fix Kaleidoscope code example
* replace virtual with override
* use default like in full code example

Differential Revision: https://reviews.llvm.org/D123110
2022-04-06 10:41:10 +01:00
Danny Mösch
a749e3295d Replace links to archived mailing lists by links to Discourse forums 2022-03-23 10:10:20 -04:00
Bill Wendling
114a8903b8 [docs] Fix typo in tutorial
Use "operands" instead of "operators"

Closes #54397
2022-03-16 11:44:23 -07:00
Arthur Eubanks
2fa87ab524 [docs] Replace opt -analyze with better alternatives.
`opt -analyze` is legacy PM-specific. Show better ways of doing the same
thing, generally with some sort of `-passes=print<foo>`.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D119486
2022-02-10 15:38:31 -08:00
Jinsong Ji
557a17eec0 [docs]LLVM Tutorial: fix the typo in Cpu0 URL
jonathan2251.github.com/lbd/ is 404. Update the URL to .io one according
to https://github.com/Jonathan2251/lbd/blob/master/README.md.
2021-12-20 21:45:57 +00:00
Shao-Ce SUN
0c660256eb [NFC] Trim trailing whitespace in *.rst 2021-11-15 09:17:08 +08:00
Yuichi Yoshida
1708d17423 Reformulate OrcJIT tutorial doc to make it more clear.
Fixed a minor writing error. The text was hard to understand.

Reviewed By: lhames, mehdi_amini

Differential Revision: https://reviews.llvm.org/D106235
2021-09-03 04:59:37 +00:00
Yuichi Yoshida
8ae31b08d9 Reformulate OrcJIT tutorial doc to make it more clear.
Fixed a minor writing error. The text was hard to understand.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D105899
2021-07-14 05:48:01 +00:00
Jim Lin
391f9ef1aa [docs] Fix load instructions in chapter 7 of the tutorial
Loads in the first half of the chapter are missing the type argument.

Patched By: klao (Mihaly Barasz)

Reviewed By: Jim

Differential Revision: https://reviews.llvm.org/D90326
2021-06-09 17:39:11 +08:00
Jon Roelofs
0bae93771d s/setGenerator/addGenerator/ in the JIT docs. NFC 2021-04-15 15:54:28 -07:00
Kazu Hirata
e8fa9014cc [llvm] Fix typos in documentation (NFC) 2021-02-27 10:09:23 -08:00
xgupta
4fc6ff07b4 [Draft] [examples] Move llvm/examples/OCaml-Kaleidoscope/ to llvm-archive 2021-02-11 06:52:24 +05:30
xgupta
3546b37221 [Doc][NFC] Fix Kaleidoscope links, typos and add blog posts for MCJIT 2021-01-25 19:59:36 +05:30
Fangrui Song
8c4e55762d [docs][unittest][Go][StackProtector] Migrate deprecated DebugInfo::get to DILocation::get 2020-12-15 14:17:04 -08:00
Lang Hames
ad92f16ccc [ORC][examples] Update Kaleidoscope and BuildingAJIT tutorial series to OrcV2.
This patch updates the Kaleidoscope and BuildingAJIT tutorial series (chapter
1-4) to OrcV2. Chapter 5 of the BuildingAJIT series is removed -- it will be
re-instated once we have in-tree support for out-of-process JITing.

This patch only updates the tutorial code, not the text. Patches welcome for
that, otherwise I will try to update it in a few weeks.
2020-10-18 21:03:04 -07:00
Han Seoul-Oh
e15996b5c6 [doc] Fix broken link 2020-09-15 09:58:08 +02:00
Chris Morin
28da5759bd Fix typo in tutorial 2020-07-21 17:28:24 +02:00
Erich Keane
884fb45ed2 Update Kaleidoscope tutorial inline code
Reported on IRC, the tutorial code at the bottom of the page correctly
namespaces the FunctionPassManager, but the as-you-go code does not.
This patch adds the namespace to those.
2020-06-12 12:02:35 -07:00
Kazuaki Ishizaki
0312b9f550 [llvm] NFC: Fix trivial typo in rst and td files
Differential Revision: https://reviews.llvm.org/D77469
2020-04-23 14:26:32 +09:00
Sylvestre Ledru
72fd1033ea Doc: Links should use https 2020-03-22 22:49:33 +01:00
Jonathan Roelofs
6bfd10ff80 Fix internal links in Kaleidoscope tutorial 2020-03-09 15:07:44 -06:00
Kazuaki Ishizaki
f65d4aa960 [llvm] NFC: fix trivial typos in documents
Reviewers: hans, Jim

Reviewed By: Jim

Subscribers: jvesely, nhaehnle, mgorny, arphaman, bmahjour, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73017
2020-01-22 11:32:51 +08:00
Brian Gesiak
5864cb38da [docs] Fix broken links in Kaleidoscope chapter 3
Several links in this document referred to `LangImpl4.html` or
`LangImpl7.html`. However, now these pages use two digits, so for these
links to function they need to be modified to `LangImpl04.html`, and so
on -- note the extra `0`.
2019-11-17 21:35:02 -05:00
kristina
5e782e74b3 [Docs] Remove stray :doc: directive. 2019-11-16 23:32:48 +00:00
kristina
fb55d56fcf [Docs] Fix sphinx warning.
Fix sphinx warning over an ambigious reference.
2019-11-16 23:23:26 +00:00
kristina
63cf704081 [Docs] Try fixing the tutorial toctree
Unorphan the old tutorial and reference every page in the index
explicitly. This should hopefully make Sphinx generate correct
hyperlinks now.
2019-11-16 23:06:50 +00:00
kristina
2916489c54 [Docs] Fix relative links in tutorial.
Update relative links in Kaleidoscope tutorial.
2019-11-16 21:09:16 +00:00
Reid Kleckner
1dfede3122 Move CodeGenFileType enum to Support/CodeGen.h
Avoids the need to include TargetMachine.h from various places just for
an enum. Various other enums live here, such as the optimization level,
TLS model, etc. Data suggests that this change probably doesn't matter,
but it seems nice to have anyway.
2019-11-13 16:39:34 -08:00
Nico Weber
bb69208df8 Fix a few spellos in docs.
(Trying to debug an incremental build thing on a bot...)

llvm-svn: 371860
2019-09-13 14:58:24 +00:00
Jonas Devlieghere
0eaee545ee [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013
2019-08-15 15:54:37 +00:00