зеркало из https://github.com/dotnet/llilc.git
Fixed formatting in documentation
Some spacing where incorrect, thus markdown was rendered the wrong way.
This commit is contained in:
Родитель
9d6a522deb
Коммит
dd0fa8c55e
|
@ -38,10 +38,10 @@ may be replaced in all commands below with the directory of your choice.
|
|||
* Because LLILC is structured as an LLVM tool, it is canonically cloned
|
||||
into the `tools` subdirectory of the LLVM tree created above:
|
||||
|
||||
```
|
||||
> cd c:\dotnet\llvm\tools
|
||||
> git clone https://github.com/dotnet/llilc
|
||||
```
|
||||
```
|
||||
> cd c:\dotnet\llvm\tools
|
||||
> git clone https://github.com/dotnet/llilc
|
||||
```
|
||||
|
||||
* This will create a directory tree under `llilc` that contains the cloned
|
||||
sources.
|
||||
|
@ -67,26 +67,26 @@ may be replaced in all commands below with the directory of your choice.
|
|||
* Create a Visual Studio Solution for LLVM + LLILC
|
||||
* Create a directory to hold the LLVM build output:
|
||||
|
||||
```
|
||||
> cd c:\dotnet
|
||||
> mkdir llvm-build
|
||||
```
|
||||
```
|
||||
> cd c:\dotnet
|
||||
> mkdir llvm-build
|
||||
```
|
||||
|
||||
* Run cmake from within the newly-created `llvm-build` directory with the
|
||||
Visual Studio backend to generate the LLVM solution:
|
||||
|
||||
```
|
||||
> cd llvm-build
|
||||
> cmake -G "Visual Studio 12 2013 Win64" ..\llvm -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
```
|
||||
note: for Windows $platform should resolve to 'Windows_NT'
|
||||
```
|
||||
> cd llvm-build
|
||||
> cmake -G "Visual Studio 12 2013 Win64" ..\llvm -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
```
|
||||
note: for Windows $platform should resolve to 'Windows_NT'
|
||||
|
||||
* However if you also want to run Doxygen, use the following instead:
|
||||
|
||||
```
|
||||
> cd llvm-build
|
||||
> cmake -G "Visual Studio 12 2013 Win64" ..\llvm -DLLVM_ENABLE_DOXYGEN=ON -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
```
|
||||
```
|
||||
> cd llvm-build
|
||||
> cmake -G "Visual Studio 12 2013 Win64" ..\llvm -DLLVM_ENABLE_DOXYGEN=ON -DWITH_CORECLR=<coreclr path>\bin\Product\$platform.$arch.$build> -DLLVM_OPTIMIZED_TABLEGEN=ON
|
||||
```
|
||||
|
||||
* This will generate `LLVM.sln` inside the `llvm-build` directory.
|
||||
|
||||
|
@ -94,23 +94,24 @@ may be replaced in all commands below with the directory of your choice.
|
|||
* Change directories to the LLVM build directory and set up environment
|
||||
variables for the Visual Studio toolchain:
|
||||
|
||||
```
|
||||
> cd c:\dotnet\llvm-build
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
```
|
||||
> cd c:\dotnet\llvm-build
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
|
||||
* Start the build. Note that If you have a multi-core machine, you may
|
||||
request a faster, parallel build by adding the `/m` flag to the command
|
||||
line, optionally specifying the degree of parallelism (e.g. `/m:4`).
|
||||
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
|
||||
* To run doxygen over the LLILC sources use the following command line:
|
||||
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:doxygen-llilc
|
||||
```
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:doxygen-llilc
|
||||
```
|
||||
|
||||
The build steps above can also be done from Visual Studio by going to the
|
||||
solution explorer, right clicking the desired project (e.g. ALL_BUILD or
|
||||
|
|
|
@ -43,10 +43,10 @@ Steps that are different:
|
|||
* Unlike the [Getting Started for Windows](Getting-Started-For-Windows.md)
|
||||
directions, create a separate LLILC directory.:
|
||||
|
||||
```
|
||||
> cd $llilc-repo-dir/..
|
||||
> git clone https://github.com/dotnet/llilc
|
||||
```
|
||||
```
|
||||
> cd $llilc-repo-dir/..
|
||||
> git clone https://github.com/dotnet/llilc
|
||||
```
|
||||
|
||||
* This will create a directory tree under $llilc-repo-dir that contains
|
||||
the cloned sources.
|
||||
|
@ -54,17 +54,17 @@ Steps that are different:
|
|||
* Create a Visual Studio Solution for LLVM
|
||||
* Create a directory to hold the LLVM build output:
|
||||
|
||||
```
|
||||
> mkdir $llvm-build-dir
|
||||
```
|
||||
```
|
||||
> mkdir $llvm-build-dir
|
||||
```
|
||||
|
||||
* Run cmake from within the newly-created `llvm-build` directory with the
|
||||
Visual Studio backend to generate the LLVM solution:
|
||||
|
||||
```
|
||||
> cd $llvm-build-dir
|
||||
> cmake -G "Visual Studio 12 2013 Win64" $llvm-repo-dir -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_ENABLE_DOXYGEN=ON
|
||||
```
|
||||
```
|
||||
> cd $llvm-build-dir
|
||||
> cmake -G "Visual Studio 12 2013 Win64" $llvm-repo-dir -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_ENABLE_DOXYGEN=ON
|
||||
```
|
||||
|
||||
* This will generate `LLVM.sln` inside the $llvm-build-dir directory.
|
||||
|
||||
|
@ -72,47 +72,49 @@ Steps that are different:
|
|||
* Change directories to the LLVM build directory and set up environment
|
||||
variables for the Visual Studio toolchain:
|
||||
|
||||
```
|
||||
> cd $llvm-build-dir
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
```
|
||||
> cd $llvm-build-dir
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
|
||||
* Start the build. Note that If you have a multi-core machine, you may
|
||||
request a faster, parallel build by adding the `/m` flag to the command
|
||||
line, optionally specifying the degree of parallelism (e.g. `/m:4`).
|
||||
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
|
||||
* Create a Visual Studio Solution for LLILC
|
||||
* Create a directory to hold the LLILC build output:
|
||||
|
||||
```
|
||||
> mkdir $llilc-build-dir
|
||||
```
|
||||
```
|
||||
> mkdir $llilc-build-dir
|
||||
```
|
||||
|
||||
* Run cmake from within the newly-created `llilc-build` directory with the
|
||||
Visual Studio backend to generate the LLVM solution:
|
||||
|
||||
```
|
||||
> cd $llilc-build-dir
|
||||
> cmake -G "Visual Studio 12 2013 Win64" $llilc-repo-dir -DWITH_CORECLR=$coreclr-build-dir -DWITH_LLVM=$llvm-build-dir -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_ENABLE_DOXYGEN=ON
|
||||
```
|
||||
```
|
||||
> cd $llilc-build-dir
|
||||
> cmake -G "Visual Studio 12 2013 Win64" $llilc-repo-dir -DWITH_CORECLR=$coreclr-build-dir -DWITH_LLVM=$llvm-build-dir -DLLVM_OPTIMIZED_TABLEGEN=ON -DLLVM_TARGETS_TO_BUILD:STRING=X86 -DLLVM_ENABLE_DOXYGEN=ON
|
||||
```
|
||||
|
||||
* This will generate `LLILC.sln` inside the $llilc-build-dir directory.
|
||||
* Currently there is a bug in the LLVM configuration that leaves some file
|
||||
paths in Windows format with back slashes. If you get an error message
|
||||
when configuring, like
|
||||
```
|
||||
Syntax error in cmake code at
|
||||
```
|
||||
Syntax error in cmake code at
|
||||
|
||||
share/llvm/cmake/LLVMExports.cmake:233
|
||||
share/llvm/cmake/LLVMExports.cmake:233
|
||||
|
||||
when parsing string
|
||||
when parsing string
|
||||
|
||||
...C:\Program Files (x86)\...
|
||||
...C:\Program Files (x86)\...
|
||||
|
||||
Invalid escape sequence \P
|
||||
```
|
||||
Invalid escape sequence \P
|
||||
```
|
||||
you can work around it by editing the offending line by
|
||||
changing the back slashes to forward slashes.
|
||||
|
||||
|
@ -120,20 +122,21 @@ Steps that are different:
|
|||
* Change directories to the LLVM build directory and set up environment
|
||||
variables for the Visual Studio toolchain:
|
||||
|
||||
```
|
||||
> cd $llilc-build-dir
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
```
|
||||
> cd $llilc-build-dir
|
||||
> "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x64
|
||||
```
|
||||
|
||||
* Start the build. Note that If you have a multi-core machine, you may
|
||||
request a faster, parallel build by adding the `/m` flag to the command
|
||||
line, optionally specifying the degree of parallelism (e.g. `/m:4`).
|
||||
|
||||
```
|
||||
> msbuild LLILC.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
```
|
||||
> msbuild LLILC.sln /p:Configuration=Debug /p:Platform=x64 /t:ALL_BUILD
|
||||
```
|
||||
|
||||
* To run doxgen over the LLILC sources use the following command line:
|
||||
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:doxygen-llilc
|
||||
```
|
||||
```
|
||||
> msbuild LLVM.sln /p:Configuration=Debug /p:Platform=x64 /t:doxygen-llilc
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#LLILC Architecture Overview
|
||||
# LLILC Architecture Overview
|
||||
|
||||
##Introduction
|
||||
## Introduction
|
||||
|
||||
LLILC is a code generator based on LLVM for MSIL (C#). The intent of the architecture is to allow
|
||||
compilation of MSIL using industrial strength components from a C++ compiler. LLVM gives us the
|
||||
|
@ -24,7 +24,7 @@ The following are the main components of the system. In the case of CoreCLR and
|
|||
are provided by other projects/repositories and provide their own documentation. Others, like the MSIL
|
||||
reader, are provided by LLILC.
|
||||
|
||||
####CoreCLR
|
||||
#### CoreCLR
|
||||
|
||||
The CoreCLR is the open source dynamic execution environment for MSIL (C#). It provides a dynamic type system,
|
||||
a code manager that organizes compilation, and an execution engine (EE). Additionally the runtime provides the
|
||||
|
@ -45,7 +45,7 @@ contain GC references. This information is used by the garbage collector for up
|
|||
are relocated. A discussion of the garbage collector as used by LLILC is
|
||||
[here](llilc-gc.md).
|
||||
|
||||
####MSIL reader
|
||||
#### MSIL reader
|
||||
|
||||
The key component needed to start testing code generation out of LLVM and get basic methods working
|
||||
is an MSIL reader. This component takes a request from [CoreCLR](https://github.com/dotnet/coreclr) to
|
||||
|
@ -57,7 +57,7 @@ and [readerir](../lib/Reader/readerir.cpp) which is responsible
|
|||
for generating the actual BitCode. This separation of concerns allows for easier refactoring and simplifies
|
||||
BitCode creation.
|
||||
|
||||
####LLVM
|
||||
#### LLVM
|
||||
|
||||
[LLVM](http://llvm.org/) is a great code generator that supports lots of platforms and CPU targets. It also has
|
||||
facilities to be used as both a JIT and AOT compiler. This combination of features, lots of targets, and ability
|
||||
|
@ -67,7 +67,7 @@ infrastructure.
|
|||
There is a further discussion of how we're modeling the managed code semantics within LLVM in a following
|
||||
[section](#managed-semantics-in-llvm).
|
||||
|
||||
####IL Transforms
|
||||
#### IL Transforms
|
||||
|
||||
IL Transforms precondition the incoming MSIL to account for items like delegates, generics, and inter-op thunks.
|
||||
The intent of the transform phases is to flatten and simplify the C# language semantics to allow a more straight
|
||||
|
@ -76,7 +76,7 @@ forward mapping to BitCode.
|
|||
This area is not defined at this point other than to say that we're evaluating what approaches to bring over from
|
||||
Windows.
|
||||
|
||||
####Type Based Optimizations
|
||||
#### Type Based Optimizations
|
||||
|
||||
A number of optimizations can be done on the incoming programs type graph. The two key ones are tree shaking, and
|
||||
generics sharing. In tree shaking, unused types and fields are removed from the program to reduce code size and improve
|
||||
|
@ -84,7 +84,7 @@ locality. For generic sharing, where possible generic method instances are shar
|
|||
|
||||
Like the IL transforms this area is not defined. Further design work is needed for this within the AOT tool.
|
||||
|
||||
####Exception Handling Model
|
||||
#### Exception Handling Model
|
||||
|
||||
The CLR EH model includes features beyond the C++ Exception Handling model. C# allows try{} and catch(){} clauses like in
|
||||
C++ but also includes finally {} blocks as well. Additionally there are compiler synthesized exceptions that will be thrown
|
||||
|
@ -140,7 +140,7 @@ it's available.
|
|||
|
||||
## Managed Semantics in LLVM
|
||||
|
||||
###Managed optimizations
|
||||
### Managed optimizations
|
||||
|
||||
#### Managed Checks
|
||||
CLR semantics includes checks for certain kind of programing faults in an attempt to avoid certain common programmer errors.
|
||||
|
@ -157,13 +157,13 @@ there are optimizations that will either compute that the required invariant is
|
|||
or can synthesize a check that will precondition a number of accesses/operations. This language specific optimizations will
|
||||
need to be added to LLVM either through extending current passes or the introduction of new passes.
|
||||
|
||||
###Managed pointers
|
||||
### Managed pointers
|
||||
|
||||
####Supporting GC via Statepoints
|
||||
#### Supporting GC via Statepoints
|
||||
Statepoints will be inserted early during bring up to enforce correctness but we plan to switch to a late insertion scheme
|
||||
to gain more benefit from the mid-level optimizer.
|
||||
|
||||
####Interior vs base pointers
|
||||
#### Interior vs base pointers
|
||||
The GC used by the CLR differentiates between reported base pointers and interior pointers (see
|
||||
[Garbage Collection](llilc-gc.md#interior-pointers) doc for
|
||||
more details). In simple terms an interior pointer results from an arithmetic operation on a base pointer if the resulting
|
||||
|
|
Загрузка…
Ссылка в новой задаче