summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope
Commit message (Collapse)AuthorAgeFilesLines
...
* [ORC] Move ORC IR layer interface from addModuleSet to addModule and fix theLang Hames2017-06-236-68/+42
| | | | | | module type as std::shared_ptr<Module>. llvm-svn: 306166
* [ORC] Switch the object layer API from addObjectSet to addObject (singular), andLang Hames2017-06-226-12/+12
| | | | | | | | | move the ObjectCache from the IRCompileLayer to SimpleCompiler. This is the first in a series of patches aimed at cleaning up and improving the robustness and performance of the ORC APIs. llvm-svn: 306058
* [Examples] Fix some Clang-tidy modernize-use-using and Include What You Use ↵Eugene Zelenko2017-05-267-44/+43
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 303944
* [Kaleidoscope] toy.cpp use after move fixPeter Szecsi2017-05-076-6/+6
| | | | | | | | | | The variable Proto is moved at the beginning of the codegen() function. According to the comment above, the pointed object should be used due the reference P. Differential Revision: https://reviews.llvm.org/D32939 llvm-svn: 302369
* llvm/examples/Kaleidoscope/BuildingAJIT: More fixup corresponding to r295636.NAKAMURA Takumi2017-02-205-10/+10
| | | | | | I missed updating them since I just ran check-llvm (with examples) in r295645. llvm-svn: 295646
* llvm/examples/Kaleidoscope/include/KaleidoscopeJIT.h: Fixup corresponding to ↵NAKAMURA Takumi2017-02-201-2/+2
| | | | | | r295636. llvm-svn: 295645
* Kaleidoscope-Ch7: Add TranformUtils for ↵NAKAMURA Takumi2017-02-121-0/+1
| | | | | | llvm::createPromoteMemoryToRegisterPass() added in r294870. llvm-svn: 294881
* Update Kaleidoscope tutorial and improve Windows supportMehdi Amini2017-02-118-27/+90
| | | | | | | | | | | | | | | Many quoted code blocks were not in sync with the actual toy.cpp files. Improve tutorial text slightly in several places. Added some step descriptions crucial to avoid crashes (like InitializeNativeTarget* calls). Solve/workaround problems with Windows (JIT'ed method not found, using custom and standard library functions from host process). Patch by: Moritz Kroll <moritz.kroll@gmx.de> Differential Revision: https://reviews.llvm.org/D29864 llvm-svn: 294870
* Use print() instead of dump() in codeMatthias Braun2017-01-2817-36/+67
| | | | | | | The dump() functions are meant to be used in a debugger, code should typically use something like print(errs()); llvm-svn: 293365
* Chapter3/KaleidoscopeJIT.h: Fix a warning. [-Wunused-lambda-capture]NAKAMURA Takumi2017-01-261-1/+1
| | | | | | "this", aka class members, is not referred in the body. llvm-svn: 293159
* [Examples] Fix some Clang-tidy modernize-use-default and Include What You ↵Eugene Zelenko2016-11-1818-56/+216
| | | | | | | | Use warnings; other minor fixes. Differential revision: https://reviews.llvm.org/D26433 llvm-svn: 287384
* [Orc] Update the BuildingAJIT Chapter 5 server class for the recent RPC changes.Lang Hames2016-11-111-13/+3
| | | | llvm-svn: 286642
* [ORC] Re-apply 286620 with fixes for the ErrorSuccess class.Lang Hames2016-11-112-5/+5
| | | | llvm-svn: 286639
* [ORC] Revert r286620 while I investigate a bot failure.Lang Hames2016-11-112-5/+5
| | | | llvm-svn: 286621
* [ORC] Refactor the ORC RPC utilities to add some new features.Lang Hames2016-11-112-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Add support for function key negotiation. The previous version of the RPC required both sides to maintain the same enumeration for functions in the API. This means that any version skew between the client and server would result in communication failure. With this version of the patch functions (and serializable types) are defined with string names, and the derived function signature strings are used to negotiate the actual function keys (which are used for efficient call serialization). This allows clients to connect to any server that supports a superset of the API (based on the function signatures it supports). (2) Add a callAsync primitive. The callAsync primitive can be used to install a return value handler that will run as soon as the RPC function's return value is sent back from the remote. (3) Launch policies for RPC function handlers. The new addHandler method, which installs handlers for RPC functions, takes two arguments: (1) the handler itself, and (2) an optional "launch policy". When the RPC function is called, the launch policy (if present) is invoked to actually launch the handler. This allows the handler to be spawned on a background thread, or added to a work list. If no launch policy is used, the handler is run on the server thread itself. This should only be used for short-running handlers, or entirely synchronous RPC APIs. (4) Zero cost cross type serialization. You can now define serialization from any type to a different "wire" type. For example, this allows you to call an RPC function that's defined to take a std::string while passing a StringRef argument. If a serializer from StringRef to std::string has been defined for the channel type this will be used to serialize the argument without having to construct a std::string instance. This allows buffer reference types to be used as arguments to RPC calls without requiring a copy of the buffer to be made. llvm-svn: 286620
* [BuildingAJIT] Use the remote target triple to construct the TargetMachine inLang Hames2016-10-191-1/+2
| | | | | | | | | | Chapter 5. Chapter 5 demonstrates remote JITing: code is executed on the remote, not the machine running the REPL, so it's the remote's triple (and TargetMachine) that we need. llvm-svn: 284657
* [BuildingAJIT] Make the chapter 5 server export symbols.Lang Hames2016-10-191-0/+2
| | | | | | This will allow chapter 5 to work on Linux. llvm-svn: 284637
* [Kaleidoscope] Make Chapter 2 use llvm::make_unique, rather than a helper.Lang Hames2016-09-192-22/+15
| | | | | | | This essentially reverts r251936, minimizing the difference between Chapter2 and Chapter 3, and making Chapter 2's code match the tutorial text. llvm-svn: 281945
* [ORC] Update examples for header changes in r281171.Lang Hames2016-09-111-2/+2
| | | | llvm-svn: 281178
* Fix singlton -> singleton typo.Eric Christopher2016-08-265-5/+5
| | | | llvm-svn: 279801
* Use the range variant of find instead of unpacking begin/endDavid Majnemer2016-08-111-2/+1
| | | | | | | | | If the result of the find is only used to compare against end(), just use is_contained instead. No functionality change is intended. llvm-svn: 278433
* [ExecutionEngine][MCJIT][Orc] Replace RuntimeDyld::SymbolInfo with JITSymbol.Lang Hames2016-08-016-35/+33
| | | | | | | | | | | | | | | | 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
* [Kaleidoscope][BuildingAJIT] Start filling in text for chapter 3.Lang Hames2016-07-153-14/+17
| | | | llvm-svn: 275518
* New Kaleidoscope chapter: Creating object filesWilfred Hughes2016-07-024-328/+1552
| | | | | | | | | | | | 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 llvm-svn: 274441
* [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol.Lang Hames2016-05-316-8/+8
| | | | | | | | | | 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. llvm-svn: 271350
* [Kaleidoscope][BuildingAJIT] Don't build Chapter 5 on Windows for now.Lang Hames2016-05-301-1/+3
| | | | | | The TCP setup code is currently *nix based and does not build on Windows. llvm-svn: 271194
* [Kaleidoscope][BuildingAJIT] Add code for Chapter 5 - remote JITing.Lang Hames2016-05-307-0/+1789
| | | | | | | | | | | | This chapter demonstrates lazily JITing from ASTs with the expressions being executed on a remote machine via a TCP connection. It needs some polish, but is substantially complete. Currently x86-64 SysV ABI (Darwin and Linux) only, but other architectures can be supported by changing the server code to use alternative ABI support classes from llvm/include/llvm/ExecutionEngine/Orc/OrcABISupport.h. llvm-svn: 271193
* [Kaleidoscope][Orc] Remove the reference to the Orc directory that was removedLang Hames2016-05-271-1/+0
| | | | | | in r271059. llvm-svn: 271061
* [Kaleidoscope] Remove the old Kaleidoscope/ORC tutorial series.Lang Hames2016-05-2713-5684/+0
| | | | | | This code has been superseded by the new Building A JIT series. llvm-svn: 271059
* [Kaleidoscope][BuildingAJIT] Add code for chapter 4.Lang Hames2016-05-274-0/+1479
| | | | | | | This chapter will cover lazy compilation directly from ASTs using the Compile Callbacks and Indirect Stubs APIs. llvm-svn: 271054
* [Kaleidoscope][BuildingAJIT] Remove leftover debugging output statements.Lang Hames2016-05-261-4/+0
| | | | llvm-svn: 270919
* [Kaleidoscope][BuildingAJIT] Add explicit dependence on TransformUtils to ↵Lang Hames2016-05-261-0/+1
| | | | | | Chapter3. llvm-svn: 270914
* [Kaleidoscope][BuildingAJIT] Add code for Chapter 3.Lang Hames2016-05-264-0/+1385
| | | | llvm-svn: 270909
* [Kaleidoscope][BuildingAJIT] Fix a bug in the symbol resolver in Chapter2.Lang Hames2016-05-261-1/+1
| | | | | | | | | | | Symbol resolution should be done on the top layer of the stack unless there's a good reason to do otherwise. In this case it would have worked because OptimizeLayer::addModuleSet eagerly passes all modules down to the CompileLayer, meaning that searches in CompileLayer will find the definitions. In later chapters where the top layer's addModuleSet isn't a pass-through, this would break. llvm-svn: 270899
* [Kaleidoscope][BuildingAJIT] Make the optimizeModule method for Chapter2Lang Hames2016-05-261-0/+2
| | | | | | private. llvm-svn: 270807
* [Kaleidoscope][BuildingAJIT] Add code for the 2nd chapter of the BuildingAJITLang Hames2016-05-254-0/+1369
| | | | | | tutorial. llvm-svn: 270794
* [Kaleidoscope][BuildingAJIT] Delete trailing whitespace.Lang Hames2016-05-251-1/+1
| | | | llvm-svn: 270787
* [Kaleidoscope][BuildingAJIT] Add a description of the KaleidoscopeJIT addModuleLang Hames2016-05-251-4/+15
| | | | | | method to Chapter1 of the BuildingAJIT tutorial. llvm-svn: 270778
* Fix some Include What You Use warnings in examples; other minor fixes.Eugene Zelenko2016-05-252-8/+28
| | | | | | Differential revision: http://reviews.llvm.org/D20607 llvm-svn: 270645
* [Kaleidoscope] Add an initial "Building an ORC JIT" tutorial chapter.Lang Hames2016-05-235-0/+1321
| | | | | | | | | 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. llvm-svn: 270487
* [Kaleidoscope] Fix static global ordering to prevent crash on exit.Lang Hames2016-05-225-5/+5
| | | | | | | If TheModule is declared before LLVMContext then it will be destructed after it, crashing when it tries to deregister itself from the destructed context. llvm-svn: 270381
* Fix some Clang-tidy modernize-use-bool-literals and Include What You Use ↵Eugene Zelenko2016-05-1911-96/+245
| | | | | | | | warnings in examples; other minor fixes. Differential revision: http://reviews.llvm.org/D20397 llvm-svn: 270008
* [Orc] Rename OrcArchitectureSupport to OrcABISupport and add Win32 ABI support.Lang Hames2016-05-071-2/+2
| | | | | | | | This enables lazy JITing on Windows x86-64. Patch by David. Thanks David! llvm-svn: 268845
* Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini2016-04-1416-376/+342
| | | | | | | | | | | 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> llvm-svn: 266379
* [Kaleidoscope] Rename Error -> LogError in Chapters 2-5.Lang Hames2016-03-254-64/+64
| | | | | | | 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. llvm-svn: 264427
* [Kaleidoscope] Fix 'Error' name clashes.Lang Hames2016-03-253-87/+87
| | | | llvm-svn: 264426
* [PM] Update Kaleidoscope with the new header file.Chandler Carruth2016-03-114-0/+4
| | | | llvm-svn: 263223
* Remove autoconf supportChris Bieneman2016-01-2616-214/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
* Fix examples corresponding to r257302.NAKAMURA Takumi2016-01-111-1/+1
| | | | llvm-svn: 257313
* [Orc] Fix Kaleidoscope example for change in r254693.Lang Hames2015-12-041-1/+1
| | | | llvm-svn: 254695
OpenPOWER on IntegriCloud