Граф коммитов

32 Коммитов

Автор SHA1 Сообщение Дата
Sergey Andreenko 88d2a9eae8 Build only objwriter
Delete llilc dirs from build,
fix objwriter merge conflicts to use with fresh llvm.
2017-02-03 11:31:12 -08:00
Kyungwoo Lee 623db1ae85 Fix build break for builing LLILC out of LLVM 2016-02-16 13:23:05 -08:00
Pat Gavlin 9ce4cb9293 Add support for the SysV AMD64 ABI.
Most of the work here involves adding support for aggregate arguments
that are represented as multiple primitive and aggregate arguments
that are represented as LLVM 'byvalue' arguments (i.e. LLVM arguments
with the 'byvalue' attribute). The former are used for IL by-value
struct arguments that must be passed in multiple registers; the latter
are used for by-value struct arguments that must be passed on the
stack. All arguments are classified as do enregister/do not
enregister using the interface provided by CoreCLR.
2015-11-12 17:01:34 -08:00
Pat Gavlin a5e49e1053 Fix some Linux build breaks.
- _DEBUG was not being defined when CMake was invoked without an explicit
  build type. The build now defaults to debug unless otherwise specified.
- A couple of GC-related types needed global namespace qualifiers to avoid
  name collisions.
- There were various const-cast related issues that needed resolution.
2015-10-28 21:17:35 -07:00
Andy Ayers 19b01181f5 Fix or suppress warnings building on Linux.
Suppress warnings about virtual dtors since the CLR header patterns are not clean.
Disable warnings about unknown pragmas since we use #pragma region.
Disable warnings about covered switch defaults since we use this to detect upstream enum changes.

Add a missing dtor to ReaderStack.
2015-10-10 00:07:59 -07:00
Andy Ayers 5dfba84292 Some retargeting support and warnings cleanup
For headers in "fixed" locations like the ones we get from the CLR, suppress CMake's desire to add cross-targeting prefixes.

Add some Arm64 register mappings for the GC info.

Fix warnings from Clang that were not caused by `-Wnon-virtual-dtor` or `-Wunknown-pragma`.
2015-09-21 14:39:34 -07:00
Joseph Tremoulet 089197a01c Fix cross-compile cmake error
When cmake is "cross-compiling" LLVM (which means that the build-host
which LLVM will be built on differs from the build-target/compile-host
that LLVM will be built to run on [regardless whether the built LLVM is a
cross-compiler or not]), it uses a recursive cmake invocation targeting
the build-host to build some tools that LLVM uses in its build process.
Check the LLVM_TARGET_IS_CROSSCOMPILE_HOST flag that is set in these
recursive invocations, and skip adding LLILC targets when it is set; this
is fine to do because LLILC is not one of the tools that LLVM uses in its
build process, and is necessary because the recursive invocations do not
pass the WITH_CORECLR setting that LLILC requires.

This will allow configuring with LLVM_OPTIMIZED_TABLEGEN=ON (which
internally uses cross-compiling), which can provide substantial build-time
savings.
2015-09-07 15:16:59 -04:00
Eugene Rozenfeld 45e9eddae1 Implement llilc support for ReadyToRun.
These changes implement jit features for ReadyToRun compilation.
The ReadyToRun overview is located here:
https://github.com/dotnet/coreclr/blob/master/Documentation/botr/readytorun-overview.md
It's a format that provides version resiliency on top of ngen.

These changes mostly follow what's implemented in RyuJit.

Special handling is done for the following operations:

* Type context creation
* Struct copy with write barriers: CORINFO_HELP_ASSIGN_STRUCT is not available for ReadyToRun
and is not used by RyuJit at all (it's considered inefficient). I implemented inline copy expansion.
* Field access
* isinst and castclass
* Class constructor insertion
* Static field address calculation
* Direct call target computation
* Indirect virtual call target computation
* Function pointer loading
* Object creation
* Array creation

Some additional changes:

* OptLevel is set to Default for ngen and ReadyToRun compilation
regardless of whether we are compiling debug or release.
* CodeModel is set to Default instead of JITDefault for ngen
and ReadyToRun compilation. We get rel32 relocations, which matches
what RyuJit generates.

COMPLUS_AltJitNgen is now set to * for our test runs. That ensures that
the existing ReadyToRun tests will use llilc to generate ReadyToRun images.

I verified that llilc can produce ReadyToRun images of tiny Roslyn and
can use them to compile itself and the result can run.

Closes #751, #750, #749, #748, #747, #745, #746
2015-09-04 19:19:25 -07:00
Andy Ayers e980c65c76 Fix remaining warnings, enable warnings as errors
Turn on -WX for MSVC builds of the LLILC code, if LLVM hasn't already enabled it (via LLVM_ENABLE_WERROR ON).

Make some variable definitions conditional if the only uses are in asserts.
2015-09-03 18:20:42 -07:00
Kyungwoo Lee 60e02d4882 Fix for llilc build out of llvm tree
When using RelWithDebInfo instead of Debug/Release, we failed to find llvm-config file.
The fix is to simply add such case as well.
2015-08-26 10:45:51 -07:00
Andy Ayers b19f942fa1 Fix Cmake for upcoming LLVM merge
In Microsoft/llvm@84b1665, LLVM stopped supplying a custom argument parser in favor of using the CMake builtin. We need to do likewise in LLIIC.

This is a prerequisite to merging latest LLVM sources.
2015-06-22 17:42:58 -07:00
Swaroop Sridhar 8dcbe046ce Use GcInfo Encoding in LLILC
This change build LLILC with CoreCLR's GcInfoEncoding Library.
-> The GcInfoEncoder headers and implementation are available in CoreCLR's
   Output directory.
-> include\GcInfoUtil provides (alternate implementations for) some
   data-structures and utilities used by the encoder
-> LLILC generates GcInfo correctly using the encoder.

GcInfoUtil provides the following utilities used by the GcInfoEncoder:
1) Logging functions used by the encoder
2) Helpers for bit-manipulation and overflow checking
3) A simple allocator (using new and delete)
4) SList -- a singly linked list that supports insert-at-tail.
   This is a subset of SList in CoreCLR tree, with only necessary functionality.
5) CQuickSort - A simple quick sort implementation with comparer
   overridden by the GcInfo encoder library -- from the CoreClr tree.
6) StructArrayList -- a list of arrays which has specific growth and location
   preserving characteristics -- simplified version from CoreCLR tree.
7) SimplerHashTable -- a wrapper around standard unordered map, with
   the encoder's own hashing and comparison functions.

Testing:

All LLILC Unit tests passed locally
Rosly builds without the need for code-size workarounds.
2015-05-11 18:23:23 -07:00
Matt Mitchell 200d6a842a Update PAL library name
Following mikem's change to move the pal back to a static library, update the pal we link against to the new name (coreclr).
2015-04-29 14:57:02 -07:00
Pat Gavlin d0baf1020f Fix the target triple for out-of-tree builds.
LLVMConfig.cmake (which we use when building out-of-tree) sets
TARGET_TRIPLE instead of LLVM_DEFAULT_TARGET_TRIPLE. Work around this
by setting LLVM_DEFAULT_TARGET_TRIPLE to TARGET_TRIPLE when building
out-of-tree.
2015-04-22 15:31:23 -07:00
Richard L. Ford 88dd628bac Correct main CMakeLists.txt file for standalone executables.
When configuring standalone LLILC (i.e. when the LLILC repo
is not placed in LLVM/tools), we were not setting
LLVM_RUNTIME_OUTPUT_INTDIR and LLVM_LIBRARY_OUTPUT_INTDIR.
These must be set if an executable is added.

While testing I also added a dummy (placeholder) driver to verify that
it is compiled and executable created for it. However we will wait to
check in a driver until it is actually functional.
2015-04-20 13:29:43 -07:00
Pat Gavlin f648e2e213 Fix the Linux build and some style issues.
- The PAL definitions we need from CoreCLR moved out of libcoreclr and
  into libcoreclrpal. Update CMakeLists accordingly.
- The JIT options sources were inconsistent with the rest of the code
  w.r.t. the use of the `this` pointer and were missing copyright
  headers.
2015-04-15 11:38:11 -07:00
rhadley 12db46ec62 Remove message line for CoreCLR path.
Debug output left over from bring up.  Removing it.
2015-03-31 14:43:33 -07:00
rhadley 2b2deb085f Remove checked in CoreCLR headers
Remove CLR headers and add dependency on a prebuild CoreCLR. Most of the headers in the
include\clr subdirectory are removed and now are picked up from a prebuilt coreclr so that
keeping in sync is clearer.

Remaining headers are used to support packing in the PAL.  Follow on
work will remove these dependencies.
2015-03-30 09:54:23 -07:00
Michelle McDaniel 7e65a3c9c8 Make CMake 2.8.12 default version
LLVM changed to make CMake 2.8.12 to be the default, so we need to
follow suit.
2015-03-24 10:51:01 -07:00
Bengu Li 5b7e9548a1 Fix LLVM BUILD path issue in LLILC CMakefile
First, we need to remove CACHE from the line to avoid any previously
wrong path name that polluted the cache and cmake might pick it up
from the cache.

Second, the way to pass LLVM Build directory in cmake command line
should be -DWITH_LLVM:STRING=[path to your llvm build directory] not
-DWITH_LLVM=[path to your llvm build directory].
2015-03-05 15:16:07 -08:00
Pat Gavlin 1d9f4e657e Build on OS X.
- Change libcoreclr probing to use find_library instead of find_path.
- Enable @rpath on OS X and set CMake policy 0042 to NEW.
2015-03-03 14:16:03 -08:00
Pat Gavlin d87123ed14 Two small fixes to {,lib/Jit/}CMakeLists.txt.
- LLVM recently bumped the required version of CMake to 2.8.12.2, which
  contains proper support for private linkage in link_target_library.
  This commit removes the workaround that had previously been in place.
- LLVM probing was slightly off for out-of-tree builds.
2015-02-25 11:33:38 -08:00
Pat Gavlin 26a8e4cc2f Accommodate out-of-tree documentation builds.
- Set LLILC_ENABLE_DOXYGEN if LLVM_ENABLE_DOXYGEN is set
- Find Doxygen and Graphviz at configure time when building out-of-tree
  or when LLILC_ENABLE_DOXYGEN is set and LLVM_ENABLE_DOXYGEN is not
2015-02-23 18:17:14 -08:00
Richard L. Ford 101a14d788 Add build target for running Doxygen
In more detail:
Modified LLILC's CMakeLists.txt to
 1. Add an LLILC_ENABLE_DOXYGEN option (ON by default)
 2. configure a Doxygen configuration file.
 3. Add a custom target, doxygen-llilc, to run doxygen.

In addition a file, Documentation/index.dox, is added that has the main page
 for the LLILC Doxygen output.

To use you need to do the following:
 1. Install Doxygen
 2. Install Graphviz, ensuring that dot is on your path.
 3. In your LLVM source directory, edit the CMakeLists.txt file so that LLVM_ENABLE_DOXYGEN is ON, or alternately when you run cmake give it an option to enable it.
 4. After you configure LLVM you can open the LLVM.sln file, right click on doxygen-llilc, and select "build". You do not need to build LLVM before doing this.
2015-02-23 15:34:48 -08:00
Pat Gavlin b1897392de Fail early if libcoreclr.so cannot be found. 2015-02-20 16:09:34 -08:00
Pat Gavlin 7b476865f6 Remove some debug messasges from CMakeLists.txt. 2015-02-20 13:29:08 -08:00
Pat Gavlin eb1fadee6c Replace LLVM-MSILC and friends with LLILC throughout the codebase. 2015-02-19 20:56:30 -08:00
Pat Gavlin 92177291e1 Small fixes for the Linux build.
- Don't use find_package for LLVM if MSILC_WITH_LLVM is defined
- Probe for libcoreclr.so whether or not we are building from within
  the LLVM tree.
- Move the definition for __stdcall outside of an outer _MSC_VER guard.
2015-02-19 15:43:17 -08:00
Pat Gavlin a805e9de69 Cleanup CMakeLists.txt.
- Remove MSILCJIT_PATH_TO_LLVM_SOURCE
- Rename MSILCJIT_PATH_TO_{LLVM_BUILD,CORECLR} to MSILC_WITH_{LLVM,CORECLR}
- Improve probing for LLVM and CoreCLR
- Switch ad-hoc discovery of certain LLVM components to definitions from
  LLVMConfig.cmake
2015-02-18 11:39:46 -08:00
Pat Gavlin 434f17a8c6 Lower FRem as a call to CORINFO_HELP_{FLT,DBL}REM.
The backend will fail to emit functions containing FRem instructions
on platforms where fmod is not available at runtime; this currently
includes CoreCLR on Windows (by default, at least).

We may be able to defer this lowering by changing the target library
options for the backend, but this likely requires a change to MCJIT.

Fixes #19.
2015-02-17 12:57:58 -08:00
Pat Gavlin f1ed3fa74f Fix errors encoutered when building with LLVM 3.7.
- libcoreclr need to be passed to the linker when linking libmsilcjit
  on Linux in order to avoid undefined symbol errors
- Replace a number of MSVC-specific attributes with their GCC/Clang
  equivalents
- Clean up some type/variable naming conflicts
- Migrate MSILCJit to use unique_ptr to track module ownership.

Don't link against libcoreclr on Windows.
2015-02-15 12:59:27 -08:00
dotnet-bot 63dbfe850d Initial commit 2015-02-12 14:54:02 -08:00