2012-04-20 00:31:37 +08:00
|
|
|
|
Overview
|
|
|
|
|
========
|
|
|
|
|
|
|
|
|
|
.. warning::
|
|
|
|
|
|
|
|
|
|
If you are using a released version of LLVM, see `the download page
|
|
|
|
|
<http://llvm.org/releases/>`_ to find your documentation.
|
|
|
|
|
|
|
|
|
|
The LLVM compiler infrastructure supports a wide range of projects, from
|
|
|
|
|
industrial strength compilers to specialized JIT applications to small
|
|
|
|
|
research projects.
|
|
|
|
|
|
|
|
|
|
Similarly, documentation is broken down into several high-level groupings
|
2012-06-02 18:20:22 +08:00
|
|
|
|
targeted at different audiences:
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
LLVM Design & Overview
|
|
|
|
|
======================
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Several introductory papers and presentations.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
.. toctree::
|
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
|
|
LangRef
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LangRef`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Defines the LLVM intermediate representation.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`Introduction to the LLVM Compiler`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Presentation providing a users introduction to LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
.. __: http://llvm.org/pubs/2008-10-04-ACAT-LLVM-Intro.html
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`Intro to LLVM`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Book chapter providing a compiler hacker's introduction to LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
.. __: http://www.aosabook.org/en/llvm.html
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
|
|
|
|
|
`LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Design overview.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
.. __: http://llvm.org/pubs/2004-01-30-CGO-LLVM.html
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`LLVM: An Infrastructure for Multi-Stage Optimization`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
More details (quite old now).
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
.. __: http://llvm.org/pubs/2002-12-LattnerMSThesis.html
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`Publications mentioning LLVM <http://llvm.org/pubs>`_
|
|
|
|
|
..
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
|
|
|
|
User Guides
|
|
|
|
|
===========
|
|
|
|
|
|
|
|
|
|
For those new to the LLVM system.
|
|
|
|
|
|
|
|
|
|
NOTE: If you are a user who is only interested in using LLVM-based
|
|
|
|
|
compilers, you should look into `Clang <http://clang.llvm.org>`_ or
|
|
|
|
|
`DragonEgg <http://dragonegg.llvm.org>`_ instead. The documentation here is
|
|
|
|
|
intended for users who have a need to work with the intermediate LLVM
|
|
|
|
|
representation.
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
|
|
CMake
|
2016-04-30 04:34:54 +08:00
|
|
|
|
CMakePrimer
|
2016-03-19 05:57:51 +08:00
|
|
|
|
AdvancedBuilds
|
2013-01-20 10:19:36 +08:00
|
|
|
|
HowToBuildOnARM
|
Add docs+a script for building clang/LLVM with PGO
Depending on who you ask, PGO grants a 15%-25% improvement in build
times when using clang. Sadly, hooking everything up properly to
generate a profile and apply it to clang isn't always straightforward.
This script (and the accompanying docs) aim to make this process easier;
ideally, a single invocation of the given script.
In terms of testing, I've got a cronjob on my Debian box that's meant to
run this a few times per week, and I tried manually running it on a puny
Gentoo box I have (four whole Atom cores!). Nothing obviously broke.
¯\_(ツ)_/¯
I don't know if we have a Python style guide, so I just shoved this
through yapf with all the defaults on.
Finally, though the focus is clang at the moment, the hope is that this
is easily applicable to other LLVM-y tools with minimal effort (e.g.
lld, opt, ...). Hence, this lives in llvm/utils and tries to be somewhat
ambiguous about naming.
Differential Revision: https://reviews.llvm.org/D53598
llvm-svn: 345427
2018-10-27 04:56:03 +08:00
|
|
|
|
HowToBuildWithPGO
|
2017-11-07 17:40:05 +08:00
|
|
|
|
HowToCrossCompileBuiltinsOnArm
|
2013-09-09 04:44:48 +08:00
|
|
|
|
HowToCrossCompileLLVM
|
2013-01-20 10:19:36 +08:00
|
|
|
|
CommandGuide/index
|
|
|
|
|
GettingStarted
|
|
|
|
|
GettingStartedVS
|
|
|
|
|
FAQ
|
|
|
|
|
Lexicon
|
|
|
|
|
HowToAddABuilder
|
|
|
|
|
yaml2obj
|
|
|
|
|
HowToSubmitABug
|
|
|
|
|
SphinxQuickstartTemplate
|
2018-08-06 08:38:31 +08:00
|
|
|
|
MarkdownQuickstartTemplate
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Phabricator
|
|
|
|
|
TestingGuide
|
|
|
|
|
tutorial/index
|
|
|
|
|
ReleaseNotes
|
|
|
|
|
Passes
|
|
|
|
|
YamlIO
|
2013-03-30 23:32:50 +08:00
|
|
|
|
GetElementPtr
|
2015-02-28 07:14:50 +08:00
|
|
|
|
Frontend/PerformanceTips
|
2013-09-10 03:09:00 +08:00
|
|
|
|
MCJITDesignAndImplementation
|
2016-07-01 04:27:54 +08:00
|
|
|
|
CodeOfConduct
|
2015-11-11 06:35:47 +08:00
|
|
|
|
CompileCudaWithLLVM
|
2016-07-01 04:27:54 +08:00
|
|
|
|
ReportingGuide
|
2017-05-25 00:39:12 +08:00
|
|
|
|
Benchmarking
|
2017-06-30 17:46:45 +08:00
|
|
|
|
Docker
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`GettingStarted`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Discusses how to get up and running quickly with the LLVM infrastructure.
|
|
|
|
|
Everything from unpacking and compilation of the distribution to execution
|
|
|
|
|
of some tools.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`CMake`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
An addendum to the main Getting Started guide for those using the `CMake
|
|
|
|
|
build system <http://www.cmake.org>`_.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`HowToBuildOnARM`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Notes on building and testing LLVM/Clang on ARM.
|
|
|
|
|
|
Add docs+a script for building clang/LLVM with PGO
Depending on who you ask, PGO grants a 15%-25% improvement in build
times when using clang. Sadly, hooking everything up properly to
generate a profile and apply it to clang isn't always straightforward.
This script (and the accompanying docs) aim to make this process easier;
ideally, a single invocation of the given script.
In terms of testing, I've got a cronjob on my Debian box that's meant to
run this a few times per week, and I tried manually running it on a puny
Gentoo box I have (four whole Atom cores!). Nothing obviously broke.
¯\_(ツ)_/¯
I don't know if we have a Python style guide, so I just shoved this
through yapf with all the defaults on.
Finally, though the focus is clang at the moment, the hope is that this
is easily applicable to other LLVM-y tools with minimal effort (e.g.
lld, opt, ...). Hence, this lives in llvm/utils and tries to be somewhat
ambiguous about naming.
Differential Revision: https://reviews.llvm.org/D53598
llvm-svn: 345427
2018-10-27 04:56:03 +08:00
|
|
|
|
:doc:`HowToBuildWithPGO`
|
|
|
|
|
Notes on building LLVM/Clang with PGO.
|
|
|
|
|
|
2017-11-07 17:40:05 +08:00
|
|
|
|
:doc:`HowToCrossCompileBuiltinsOnArm`
|
|
|
|
|
Notes on cross-building and testing the compiler-rt builtins for Arm.
|
|
|
|
|
|
2013-09-09 04:44:48 +08:00
|
|
|
|
:doc:`HowToCrossCompileLLVM`
|
|
|
|
|
Notes on cross-building and testing LLVM/Clang.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`GettingStartedVS`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
An addendum to the main Getting Started guide for those using Visual Studio
|
|
|
|
|
on Windows.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`tutorial/index`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Tutorials about using LLVM. Includes a tutorial about making a custom
|
|
|
|
|
language with LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LLVM Command Guide <CommandGuide/index>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A reference manual for the LLVM command line utilities ("man" pages for LLVM
|
|
|
|
|
tools).
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Passes`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A list of optimizations and analyses implemented in LLVM.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`FAQ`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A list of common questions and problems and their solutions.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Release notes for the current release <ReleaseNotes>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This describes new features, known bugs, and other limitations.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`HowToSubmitABug`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Instructions for properly submitting information about any bugs you run into
|
|
|
|
|
in the LLVM system.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`SphinxQuickstartTemplate`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A template + tutorial for writing new Sphinx documentation. It is meant
|
|
|
|
|
to be read in source form.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LLVM Testing Infrastructure Guide <TestingGuide>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A reference manual for using the LLVM testing infrastructure.
|
|
|
|
|
|
2018-09-01 05:47:01 +08:00
|
|
|
|
:doc:`TestSuiteGuide`
|
|
|
|
|
Describes how to compile and run the test-suite benchmarks.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`How to build the C, C++, ObjC, and ObjC++ front end`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Instructions for building the clang front-end from source.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
.. __: http://clang.llvm.org/get_started.html
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Lexicon`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Definition of acronyms, terms and concepts used in LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`HowToAddABuilder`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Instructions for adding new builder to LLVM buildbot master.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`YamlIO`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A reference guide for using LLVM's YAML I/O library.
|
|
|
|
|
|
2013-03-30 23:32:50 +08:00
|
|
|
|
:doc:`GetElementPtr`
|
|
|
|
|
Answers to some very frequent questions about LLVM's most frequently
|
|
|
|
|
misunderstood instruction.
|
|
|
|
|
|
2015-02-28 07:14:50 +08:00
|
|
|
|
:doc:`Frontend/PerformanceTips`
|
2017-09-21 04:38:14 +08:00
|
|
|
|
A collection of tips for frontend authors on how to generate IR
|
2015-02-28 07:14:50 +08:00
|
|
|
|
which LLVM is able to effectively optimize.
|
|
|
|
|
|
2017-06-30 17:46:45 +08:00
|
|
|
|
:doc:`Docker`
|
|
|
|
|
A reference for using Dockerfiles provided with LLVM.
|
|
|
|
|
|
2015-02-28 07:14:50 +08:00
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Programming Documentation
|
|
|
|
|
=========================
|
|
|
|
|
|
|
|
|
|
For developers of applications which use LLVM as a library.
|
2012-04-20 00:31:37 +08:00
|
|
|
|
|
|
|
|
|
.. toctree::
|
2013-01-20 10:19:36 +08:00
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
|
|
Atomics
|
|
|
|
|
CodingStandards
|
|
|
|
|
CommandLine
|
|
|
|
|
CompilerWriterInfo
|
|
|
|
|
ExtendingLLVM
|
|
|
|
|
HowToSetUpLLVMStyleRTTI
|
|
|
|
|
ProgrammersManual
|
2013-04-11 07:28:17 +08:00
|
|
|
|
Extensions
|
2015-03-31 07:05:30 +08:00
|
|
|
|
LibFuzzer
|
2017-10-12 09:44:24 +08:00
|
|
|
|
FuzzingLLVM
|
2016-06-08 07:13:54 +08:00
|
|
|
|
ScudoHardenedAllocator
|
2016-08-27 07:11:48 +08:00
|
|
|
|
OptBisect
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LLVM Language Reference Manual <LangRef>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Defines the LLVM intermediate representation and the assembly form of the
|
|
|
|
|
different nodes.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Atomics`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Information about LLVM's concurrency model.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`ProgrammersManual`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Introduction to the general layout of the LLVM sourcebase, important classes
|
|
|
|
|
and APIs, and some tips & tricks.
|
|
|
|
|
|
2013-04-11 07:28:17 +08:00
|
|
|
|
:doc:`Extensions`
|
|
|
|
|
LLVM-specific extensions to tools and formats LLVM seeks compatibility with.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`CommandLine`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Provides information on using the command line parsing library.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`CodingStandards`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Details the LLVM coding standards and provides useful information on writing
|
|
|
|
|
efficient C++ code.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`HowToSetUpLLVMStyleRTTI`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
How to make ``isa<>``, ``dyn_cast<>``, etc. available for clients of your
|
|
|
|
|
class hierarchy.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`ExtendingLLVM`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Look here to see how to add instructions and intrinsics to LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`Doxygen generated documentation <http://llvm.org/doxygen/>`_
|
2013-01-20 10:19:36 +08:00
|
|
|
|
(`classes <http://llvm.org/doxygen/inherits.html>`_)
|
|
|
|
|
|
2015-01-14 02:49:42 +08:00
|
|
|
|
`Documentation for Go bindings <http://godoc.org/llvm.org/llvm/bindings/go/llvm>`_
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
`ViewVC Repository Browser <http://llvm.org/viewvc/>`_
|
|
|
|
|
..
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`CompilerWriterInfo`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A list of helpful links for compiler writers.
|
|
|
|
|
|
2015-03-31 07:05:30 +08:00
|
|
|
|
:doc:`LibFuzzer`
|
|
|
|
|
A library for writing in-process guided fuzzers.
|
|
|
|
|
|
2017-10-12 09:44:24 +08:00
|
|
|
|
:doc:`FuzzingLLVM`
|
|
|
|
|
Information on writing and using Fuzzers to find bugs in LLVM.
|
|
|
|
|
|
2016-06-08 07:13:54 +08:00
|
|
|
|
:doc:`ScudoHardenedAllocator`
|
|
|
|
|
A library that implements a security-hardened `malloc()`.
|
|
|
|
|
|
2016-08-27 07:11:48 +08:00
|
|
|
|
:doc:`OptBisect`
|
|
|
|
|
A command line option for debugging optimization-induced failures.
|
|
|
|
|
|
2018-01-05 01:12:21 +08:00
|
|
|
|
.. _index-subsystem-docs:
|
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Subsystem Documentation
|
|
|
|
|
=======================
|
|
|
|
|
|
|
|
|
|
For API clients and LLVM developers.
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
|
|
AliasAnalysis
|
2016-08-17 08:17:29 +08:00
|
|
|
|
MemorySSA
|
2013-01-20 10:19:36 +08:00
|
|
|
|
BitCodeFormat
|
2014-04-12 07:21:07 +08:00
|
|
|
|
BlockFrequencyTerminology
|
2013-01-20 10:19:36 +08:00
|
|
|
|
BranchWeightMetadata
|
|
|
|
|
Bugpoint
|
|
|
|
|
CodeGenerator
|
|
|
|
|
ExceptionHandling
|
|
|
|
|
LinkTimeOptimization
|
|
|
|
|
SegmentedStacks
|
|
|
|
|
TableGenFundamentals
|
2014-03-21 00:08:34 +08:00
|
|
|
|
TableGen/index
|
2013-01-20 10:19:36 +08:00
|
|
|
|
DebuggingJITedCode
|
|
|
|
|
GoldPlugin
|
|
|
|
|
MarkedUpDisassembly
|
|
|
|
|
SystemLibrary
|
2018-09-19 02:05:38 +08:00
|
|
|
|
SupportLibrary
|
2013-01-20 10:19:36 +08:00
|
|
|
|
SourceLevelDebugging
|
|
|
|
|
Vectorizers
|
|
|
|
|
WritingAnLLVMBackend
|
|
|
|
|
GarbageCollection
|
|
|
|
|
WritingAnLLVMPass
|
2013-02-12 19:45:22 +08:00
|
|
|
|
HowToUseAttributes
|
2013-03-31 00:41:14 +08:00
|
|
|
|
NVPTXUsage
|
2015-06-13 11:28:10 +08:00
|
|
|
|
AMDGPUUsage
|
2013-12-24 10:57:25 +08:00
|
|
|
|
StackMaps
|
2014-03-02 08:21:42 +08:00
|
|
|
|
InAlloca
|
2014-05-12 23:13:39 +08:00
|
|
|
|
BigEndianNEON
|
2014-08-20 01:05:58 +08:00
|
|
|
|
CoverageMappingFormat
|
2014-12-04 02:35:11 +08:00
|
|
|
|
Statepoints
|
2014-12-11 01:42:01 +08:00
|
|
|
|
MergeFunctions
|
IR: New representation for CFI and virtual call optimization pass metadata.
The bitset metadata currently used in LLVM has a few problems:
1. It has the wrong name. The name "bitset" refers to an implementation
detail of one use of the metadata (i.e. its original use case, CFI).
This makes it harder to understand, as the name makes no sense in the
context of virtual call optimization.
2. It is represented using a global named metadata node, rather than
being directly associated with a global. This makes it harder to
manipulate the metadata when rebuilding global variables, summarise it
as part of ThinLTO and drop unused metadata when associated globals are
dropped. For this reason, CFI does not currently work correctly when
both CFI and vcall opt are enabled, as vcall opt needs to rebuild vtable
globals, and fails to associate metadata with the rebuilt globals. As I
understand it, the same problem could also affect ASan, which rebuilds
globals with a red zone.
This patch solves both of those problems in the following way:
1. Rename the metadata to "type metadata". This new name reflects how
the metadata is currently being used (i.e. to represent type information
for CFI and vtable opt). The new name is reflected in the name for the
associated intrinsic (llvm.type.test) and pass (LowerTypeTests).
2. Attach metadata directly to the globals that it pertains to, rather
than using the "llvm.bitsets" global metadata node as we are doing now.
This is done using the newly introduced capability to attach
metadata to global variables (r271348 and r271358).
See also: http://lists.llvm.org/pipermail/llvm-dev/2016-June/100462.html
Differential Revision: http://reviews.llvm.org/D21053
llvm-svn: 273729
2016-06-25 05:21:32 +08:00
|
|
|
|
TypeMetadata
|
[Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.
When multiple loop transformation are defined in a loop's metadata, their order of execution is defined by the order of their respective passes in the pass pipeline. For instance, e.g.
#pragma clang loop unroll_and_jam(enable)
#pragma clang loop distribute(enable)
is the same as
#pragma clang loop distribute(enable)
#pragma clang loop unroll_and_jam(enable)
and will try to loop-distribute before Unroll-And-Jam because the LoopDistribute pass is scheduled after UnrollAndJam pass. UnrollAndJamPass only supports one inner loop, i.e. it will necessarily fail after loop distribution. It is not possible to specify another execution order. Also,t the order of passes in the pipeline is subject to change between versions of LLVM, optimization options and which pass manager is used.
This patch adds 'followup' attributes to various loop transformation passes. These attributes define which attributes the resulting loop of a transformation should have. For instance,
!0 = !{!0, !1, !2}
!1 = !{!"llvm.loop.unroll_and_jam.enable"}
!2 = !{!"llvm.loop.unroll_and_jam.followup_inner", !3}
!3 = !{!"llvm.loop.distribute.enable"}
defines a loop ID (!0) to be unrolled-and-jammed (!1) and then the attribute !3 to be added to the jammed inner loop, which contains the instruction to distribute the inner loop.
Currently, in both pass managers, pass execution is in a fixed order and UnrollAndJamPass will not execute again after LoopDistribute. We hope to fix this in the future by allowing pass managers to run passes until a fixpoint is reached, use Polly to perform these transformations, or add a loop transformation pass which takes the order issue into account.
For mandatory/forced transformations (e.g. by having been declared by #pragma omp simd), the user must be notified when a transformation could not be performed. It is not possible that the responsible pass emits such a warning because the transformation might be 'hidden' in a followup attribute when it is executed, or it is not present in the pipeline at all. For this reason, this patche introduces a WarnMissedTransformations pass, to warn about orphaned transformations.
Since this changes the user-visible diagnostic message when a transformation is applied, two test cases in the clang repository need to be updated.
To ensure that no other transformation is executed before the intended one, the attribute `llvm.loop.disable_nonforced` can be added which should disable transformation heuristics before the intended transformation is applied. E.g. it would be surprising if a loop is distributed before a #pragma unroll_and_jam is applied.
With more supported code transformations (loop fusion, interchange, stripmining, offloading, etc.), transformations can be used as building blocks for more complex transformations (e.g. stripmining+stripmining+interchange -> tiling).
Reviewed By: hfinkel, dmgreen
Differential Revision: https://reviews.llvm.org/D49281
Differential Revision: https://reviews.llvm.org/D55288
llvm-svn: 348944
2018-12-13 01:32:52 +08:00
|
|
|
|
TransformMetadata
|
2015-06-16 03:38:15 +08:00
|
|
|
|
FaultMaps
|
2015-08-07 06:55:19 +08:00
|
|
|
|
MIRLangRef
|
2016-07-23 12:05:08 +08:00
|
|
|
|
Coroutines
|
2016-11-05 01:57:34 +08:00
|
|
|
|
GlobalISel
|
2016-11-09 08:24:58 +08:00
|
|
|
|
XRay
|
2017-03-31 10:51:19 +08:00
|
|
|
|
XRayExample
|
2017-08-03 05:47:27 +08:00
|
|
|
|
XRayFDRFormat
|
2016-11-11 03:24:21 +08:00
|
|
|
|
PDB/index
|
2017-09-21 04:38:14 +08:00
|
|
|
|
CFIVerify
|
2018-08-06 08:38:31 +08:00
|
|
|
|
SpeculativeLoadHardening
|
2018-11-27 07:16:07 +08:00
|
|
|
|
StackSafetyAnalysis
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`WritingAnLLVMPass`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Information on how to write LLVM transformations and analyses.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`WritingAnLLVMBackend`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Information on how to write LLVM backends for machine targets.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`CodeGenerator`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
The design and implementation of the LLVM code generator. Useful if you are
|
|
|
|
|
working on retargetting LLVM to a new architecture, designing a new codegen
|
|
|
|
|
pass, or enhancing existing components.
|
|
|
|
|
|
2015-08-07 06:55:19 +08:00
|
|
|
|
:doc:`Machine IR (MIR) Format Reference Manual <MIRLangRef>`
|
|
|
|
|
A reference manual for the MIR serialization format, which is used to test
|
|
|
|
|
LLVM's code generation passes.
|
|
|
|
|
|
2014-04-08 06:42:53 +08:00
|
|
|
|
:doc:`TableGen <TableGen/index>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Describes the TableGen tool, which is used heavily by the LLVM code
|
|
|
|
|
generator.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`AliasAnalysis`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Information on how to write a new alias analysis implementation or how to
|
|
|
|
|
use existing analyses.
|
|
|
|
|
|
2016-08-17 08:17:29 +08:00
|
|
|
|
:doc:`MemorySSA`
|
|
|
|
|
Information about the MemorySSA utility in LLVM, as well as how to use it.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`GarbageCollection`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
The interfaces source-language compilers should use for compiling GC'd
|
|
|
|
|
programs.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Source Level Debugging with LLVM <SourceLevelDebugging>`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes the design and philosophy behind the LLVM
|
|
|
|
|
source-level debugger.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Vectorizers`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes the current status of vectorization in LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`ExceptionHandling`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes the design and implementation of exception handling
|
|
|
|
|
in LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Bugpoint`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Automatic bug finder and test-case reducer description and usage
|
|
|
|
|
information.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`BitCodeFormat`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This describes the file format and encoding used for LLVM "bc" files.
|
|
|
|
|
|
2018-09-19 02:05:38 +08:00
|
|
|
|
:doc:`Support Library <SupportLibrary>`
|
|
|
|
|
This document describes the LLVM Support Library (``lib/Support``) and
|
2013-01-20 10:19:36 +08:00
|
|
|
|
how to keep LLVM source code portable
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LinkTimeOptimization`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes the interface between LLVM intermodular optimizer
|
|
|
|
|
and the linker and its design
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`GoldPlugin`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
How to build your programs with link-time optimization on Linux.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`DebuggingJITedCode`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
How to debug JITed code with GDB.
|
|
|
|
|
|
2013-08-22 06:15:09 +08:00
|
|
|
|
:doc:`MCJITDesignAndImplementation`
|
|
|
|
|
Describes the inner workings of MCJIT execution engine.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`BranchWeightMetadata`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Provides information about Branch Prediction Information.
|
|
|
|
|
|
2014-04-12 07:21:07 +08:00
|
|
|
|
:doc:`BlockFrequencyTerminology`
|
|
|
|
|
Provides information about terminology used in the ``BlockFrequencyInfo``
|
|
|
|
|
analysis pass.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`SegmentedStacks`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes segmented stacks and how they are used in LLVM.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`MarkedUpDisassembly`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This document describes the optional rich disassembly output syntax.
|
|
|
|
|
|
2013-02-12 19:45:22 +08:00
|
|
|
|
:doc:`HowToUseAttributes`
|
|
|
|
|
Answers some questions about the new Attributes infrastructure.
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-03-31 00:41:14 +08:00
|
|
|
|
:doc:`NVPTXUsage`
|
2017-06-07 04:31:59 +08:00
|
|
|
|
This document describes using the NVPTX backend to compile GPU kernels.
|
2013-03-31 00:41:14 +08:00
|
|
|
|
|
2015-06-13 11:28:10 +08:00
|
|
|
|
:doc:`AMDGPUUsage`
|
2017-06-07 04:31:59 +08:00
|
|
|
|
This document describes using the AMDGPU backend to compile GPU kernels.
|
2014-11-14 22:08:00 +08:00
|
|
|
|
|
2013-12-24 10:57:25 +08:00
|
|
|
|
:doc:`StackMaps`
|
|
|
|
|
LLVM support for mapping instruction addresses to the location of
|
|
|
|
|
values and allowing code to be patched.
|
2013-03-31 00:41:14 +08:00
|
|
|
|
|
2014-05-12 23:13:39 +08:00
|
|
|
|
:doc:`BigEndianNEON`
|
|
|
|
|
LLVM's support for generating NEON instructions on big endian ARM targets is
|
|
|
|
|
somewhat nonintuitive. This document explains the implementation and rationale.
|
|
|
|
|
|
2014-08-20 01:05:58 +08:00
|
|
|
|
:doc:`CoverageMappingFormat`
|
|
|
|
|
This describes the format and encoding used for LLVM’s code coverage mapping.
|
2014-05-12 23:13:39 +08:00
|
|
|
|
|
2014-12-04 02:35:11 +08:00
|
|
|
|
:doc:`Statepoints`
|
|
|
|
|
This describes a set of experimental extensions for garbage
|
|
|
|
|
collection support.
|
|
|
|
|
|
2014-12-11 01:42:01 +08:00
|
|
|
|
:doc:`MergeFunctions`
|
|
|
|
|
Describes functions merging optimization.
|
|
|
|
|
|
2015-02-05 04:51:19 +08:00
|
|
|
|
:doc:`InAlloca`
|
|
|
|
|
Description of the ``inalloca`` argument attribute.
|
|
|
|
|
|
2015-06-16 03:38:15 +08:00
|
|
|
|
:doc:`FaultMaps`
|
|
|
|
|
LLVM support for folding control flow into faulting machine instructions.
|
|
|
|
|
|
2015-11-11 06:35:47 +08:00
|
|
|
|
:doc:`CompileCudaWithLLVM`
|
|
|
|
|
LLVM support for CUDA.
|
|
|
|
|
|
2016-07-23 12:05:08 +08:00
|
|
|
|
:doc:`Coroutines`
|
|
|
|
|
LLVM support for coroutines.
|
|
|
|
|
|
2016-11-05 01:57:34 +08:00
|
|
|
|
:doc:`GlobalISel`
|
|
|
|
|
This describes the prototype instruction selection replacement, GlobalISel.
|
|
|
|
|
|
2016-11-09 08:24:58 +08:00
|
|
|
|
:doc:`XRay`
|
|
|
|
|
High-level documentation of how to use XRay in LLVM.
|
|
|
|
|
|
2017-03-31 07:46:36 +08:00
|
|
|
|
:doc:`XRayExample`
|
|
|
|
|
An example of how to debug an application with XRay.
|
|
|
|
|
|
2016-11-11 03:24:21 +08:00
|
|
|
|
:doc:`The Microsoft PDB File Format <PDB/index>`
|
|
|
|
|
A detailed description of the Microsoft PDB (Program Database) file format.
|
|
|
|
|
|
2017-09-21 04:38:14 +08:00
|
|
|
|
:doc:`CFIVerify`
|
|
|
|
|
A description of the verification tool for Control Flow Integrity.
|
|
|
|
|
|
2018-08-06 08:38:31 +08:00
|
|
|
|
:doc:`SpeculativeLoadHardening`
|
|
|
|
|
A description of the Speculative Load Hardening mitigation for Spectre v1.
|
|
|
|
|
|
2018-11-27 07:16:07 +08:00
|
|
|
|
:doc:`StackSafetyAnalysis`
|
|
|
|
|
This document describes the design of the stack safety analysis of local
|
|
|
|
|
variables.
|
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Development Process Documentation
|
|
|
|
|
=================================
|
|
|
|
|
|
|
|
|
|
Information about LLVM's development process.
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:hidden:
|
|
|
|
|
|
2018-01-05 01:12:21 +08:00
|
|
|
|
Contributing
|
2013-03-30 23:32:47 +08:00
|
|
|
|
DeveloperPolicy
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Projects
|
|
|
|
|
LLVMBuild
|
|
|
|
|
HowToReleaseLLVM
|
2013-01-29 05:28:10 +08:00
|
|
|
|
Packaging
|
2013-09-10 03:09:00 +08:00
|
|
|
|
ReleaseProcess
|
2014-10-04 04:17:32 +08:00
|
|
|
|
Phabricator
|
2018-11-07 16:49:36 +08:00
|
|
|
|
BugLifeCycle
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2018-01-05 01:12:21 +08:00
|
|
|
|
:doc:`Contributing`
|
|
|
|
|
An overview on how to contribute to LLVM.
|
|
|
|
|
|
2013-03-30 23:32:47 +08:00
|
|
|
|
:doc:`DeveloperPolicy`
|
|
|
|
|
The LLVM project's policy towards developers and their contributions.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`Projects`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
How-to guide and templates for new projects that *use* the LLVM
|
|
|
|
|
infrastructure. The templates (directory organization, Makefiles, and test
|
|
|
|
|
tree) allow the project code to be located outside (or inside) the ``llvm/``
|
|
|
|
|
tree, while using LLVM header files and libraries.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`LLVMBuild`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Describes the LLVMBuild organization and files used by LLVM to specify
|
|
|
|
|
component descriptions.
|
|
|
|
|
|
2013-01-20 10:19:42 +08:00
|
|
|
|
:doc:`HowToReleaseLLVM`
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This is a guide to preparing LLVM releases. Most developers can ignore it.
|
|
|
|
|
|
2013-05-28 18:32:55 +08:00
|
|
|
|
:doc:`ReleaseProcess`
|
2014-09-26 14:59:15 +08:00
|
|
|
|
This is a guide to validate a new release, during the release process. Most developers can ignore it.
|
2013-05-28 18:32:55 +08:00
|
|
|
|
|
2013-01-29 05:28:10 +08:00
|
|
|
|
:doc:`Packaging`
|
|
|
|
|
Advice on packaging LLVM into a distribution.
|
|
|
|
|
|
2014-10-04 04:17:32 +08:00
|
|
|
|
:doc:`Phabricator`
|
|
|
|
|
Describes how to use the Phabricator code review tool hosted on
|
|
|
|
|
http://reviews.llvm.org/ and its command line interface, Arcanist.
|
|
|
|
|
|
2018-11-07 16:49:36 +08:00
|
|
|
|
:doc:`BugLifeCycle`
|
|
|
|
|
Describes how bugs are reported, triaged and closed.
|
|
|
|
|
|
2013-03-30 23:32:51 +08:00
|
|
|
|
Community
|
|
|
|
|
=========
|
|
|
|
|
|
|
|
|
|
LLVM has a thriving community of friendly and helpful developers.
|
|
|
|
|
The two primary communication mechanisms in the LLVM community are mailing
|
|
|
|
|
lists and IRC.
|
|
|
|
|
|
2013-01-20 10:19:36 +08:00
|
|
|
|
Mailing Lists
|
2013-03-30 23:32:51 +08:00
|
|
|
|
-------------
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
|
|
|
|
If you can't find what you need in these docs, try consulting the mailing
|
|
|
|
|
lists.
|
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
`Developer's List (llvm-dev)`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This list is for people who want to be included in technical discussions of
|
|
|
|
|
LLVM. People post to this list when they have questions about writing code
|
|
|
|
|
for or using the LLVM tools. It is relatively low volume.
|
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
.. __: http://lists.llvm.org/mailman/listinfo/llvm-dev
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2013-03-30 23:33:01 +08:00
|
|
|
|
`Commits Archive (llvm-commits)`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
This list contains all commit messages that are made when LLVM developers
|
2013-03-30 23:33:02 +08:00
|
|
|
|
commit code changes to the repository. It also serves as a forum for
|
|
|
|
|
patch review (i.e. send patches here). It is useful for those who want to
|
|
|
|
|
stay on the bleeding edge of LLVM development. This list is very high
|
|
|
|
|
volume.
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
.. __: http://lists.llvm.org/pipermail/llvm-commits/
|
2013-01-20 10:19:36 +08:00
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
`Bugs & Patches Archive (llvm-bugs)`__
|
2013-03-30 23:33:02 +08:00
|
|
|
|
This list gets emailed every time a bug is opened and closed. It is
|
2015-08-05 11:51:17 +08:00
|
|
|
|
higher volume than the LLVM-dev list.
|
2013-03-30 23:32:54 +08:00
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
.. __: http://lists.llvm.org/pipermail/llvm-bugs/
|
2013-03-30 23:32:54 +08:00
|
|
|
|
|
2013-03-30 23:33:01 +08:00
|
|
|
|
`Test Results Archive (llvm-testresults)`__
|
2013-01-20 10:19:36 +08:00
|
|
|
|
A message is automatically sent to this list by every active nightly tester
|
|
|
|
|
when it completes. As such, this list gets email several times each day,
|
|
|
|
|
making it a high volume list.
|
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
.. __: http://lists.llvm.org/pipermail/llvm-testresults/
|
2013-01-20 10:19:42 +08:00
|
|
|
|
|
2013-03-30 23:33:01 +08:00
|
|
|
|
`LLVM Announcements List (llvm-announce)`__
|
2013-03-30 23:32:54 +08:00
|
|
|
|
This is a low volume list that provides important announcements regarding
|
|
|
|
|
LLVM. It gets email about once a month.
|
|
|
|
|
|
2015-08-05 11:51:17 +08:00
|
|
|
|
.. __: http://lists.llvm.org/mailman/listinfo/llvm-announce
|
2013-03-30 23:32:54 +08:00
|
|
|
|
|
2013-03-30 23:32:51 +08:00
|
|
|
|
IRC
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
Users and developers of the LLVM project (including subprojects such as Clang)
|
|
|
|
|
can be found in #llvm on `irc.oftc.net <irc://irc.oftc.net/llvm>`_.
|
|
|
|
|
|
|
|
|
|
This channel has several bots.
|
|
|
|
|
|
|
|
|
|
* Buildbot reporters
|
|
|
|
|
|
|
|
|
|
* llvmbb - Bot for the main LLVM buildbot master.
|
|
|
|
|
http://lab.llvm.org:8011/console
|
|
|
|
|
* bb-chapuni - An individually run buildbot master. http://bb.pgr.jp/console
|
|
|
|
|
* smooshlab - Apple's internal buildbot master.
|
|
|
|
|
|
|
|
|
|
* robot - Bugzilla linker. %bug <number>
|
|
|
|
|
|
|
|
|
|
* clang-bot - A `geordi <http://www.eelis.net/geordi/>`_ instance running
|
|
|
|
|
near-trunk clang instead of gcc.
|
|
|
|
|
|
2016-07-20 17:38:04 +08:00
|
|
|
|
Community wide proposals
|
|
|
|
|
------------------------
|
|
|
|
|
|
|
|
|
|
Proposals for massive changes in how the community behaves and how the work flow
|
|
|
|
|
can be better.
|
|
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
|
:hidden:
|
|
|
|
|
|
|
|
|
|
CodeOfConduct
|
2016-10-13 07:02:02 +08:00
|
|
|
|
Proposals/GitHubMove
|
2018-10-24 03:46:29 +08:00
|
|
|
|
Proposals/TestSuite
|
2017-05-29 23:36:23 +08:00
|
|
|
|
Proposals/VectorizationPlan
|
2016-07-20 17:38:04 +08:00
|
|
|
|
|
|
|
|
|
:doc:`CodeOfConduct`
|
|
|
|
|
Proposal to adopt a code of conduct on the LLVM social spaces (lists, events,
|
|
|
|
|
IRC, etc).
|
|
|
|
|
|
2016-10-13 07:02:02 +08:00
|
|
|
|
:doc:`Proposals/GitHubMove`
|
2016-07-20 17:38:04 +08:00
|
|
|
|
Proposal to move from SVN/Git to GitHub.
|
|
|
|
|
|
2018-10-24 03:46:29 +08:00
|
|
|
|
:doc:`Proposals/TestSuite`
|
|
|
|
|
Proposals for additional benchmarks/programs for llvm's test-suite.
|
|
|
|
|
|
2017-05-29 23:36:23 +08:00
|
|
|
|
:doc:`Proposals/VectorizationPlan`
|
|
|
|
|
Proposal to model the process and upgrade the infrastructure of LLVM's Loop Vectorizer.
|
2013-03-30 23:32:51 +08:00
|
|
|
|
|
2012-04-20 00:31:37 +08:00
|
|
|
|
Indices and tables
|
|
|
|
|
==================
|
|
|
|
|
|
|
|
|
|
* :ref:`genindex`
|
|
|
|
|
* :ref:`search`
|