Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Llvm 10 #161

Merged
merged 15 commits into from
Mar 29, 2020
Merged

Llvm 10 #161

merged 15 commits into from
Mar 29, 2020

Conversation

smaillet
Copy link
Member

Support for LLVM 10 final binaries. (Requires manual local build of libs until stabilized)

NOTE: ORCJIT truly lazy generation is know to fail. (e.g. Kaleidoscope chapter 7.1 will crash - this is under investigation and will need to be resolved before the final release)

smaillet added 15 commits March 16, 2020 19:05
## Core Changes
Additional work is needed to fully support LLVM10 changes - this is just the minimum bar tp get the ball rolling.
* Added support for attributes with type parameter (IR-> managed only at this point, full support for new features later)
* Updated triple bindings to support new triple components in LLVM10

## Breaking Changes
* TargetObjectFile removed in favor of TargetBinary as it isn't really an ObjectFile only anymore. (Follows underlying changes in LLVM and the LLVM-C APIs)
* Removed  DebugInfoFlags values no longer present in underlying LLVM definitions
   - DebugInfoFlags.BlockByrefStruct
   - DebugInfoFlags.MainSubProgram
   - DebugInfoFlags.Trivial
* DiBuilder.CreateTypedef() now has an alignInBits parameter
* Fixed sample Kaleidoscope parser AST to corrrectly capture extern status of prototypes
* replaced extension LibLLVM* extension functions with new official LLVM* functions
…ng them outright, in case consumers are using it directly

* Added Kind property to AtomicRMW instructions
* Added IsWeak property to AtomicCmpXchg instructions
* Added support for the Freeze instruction
* Added additional Basic block insert/append methods
* Added support for creating macro files and macros to DebugInfoBuilder
…amework defaults. This prevents hard to track compile/runtime fails if the language features require runtime support library support.
* Made conversion of pointer to IntPtr explicit so that functions returning pointers are easier to detect
* Updated type printer to not convert all pointer types to IntPtr so that conversion is explicit.
* added new !Unsafe (and corresponding class YamlUnsafeReturn) to the configuration to explicitly allow unsafe return types on functions requiring them. (This suppresses the validation error for the specified function)
* Updated config file with APIs requiring updates based on these changes
* Corrected nullability of scopes in Debug information
…l LLVM* Functions

* Added more complete support for GlobalIFuncs, including module enumeration
* Moved to a common project/repo neutral module to leverage common functions across repos in general
* updated all the scripts to leverage new common module
* Increased strictness level to help catch bugs in the scripts earlier
…ng support to ensure they are generated with a usable signature
@smaillet smaillet merged commit c071a50 into UbiquityDotNET:llvm_10 Mar 29, 2020
@smaillet smaillet deleted the llvm_10 branch March 29, 2020 23:33
smaillet added a commit that referenced this pull request Apr 9, 2020
* Llvm 10 (#161)

## Initial pass at LLVM 10 support to get tests to pass

## Core Changes
Additional work is needed to fully support LLVM10 changes - this is just the minimum bar tp get the ball rolling.
* Added support for attributes with type parameter (IR-> managed only at this point, full support for new features later)
* Updated triple bindings to support new triple components in LLVM10

## Breaking Changes
* TargetObjectFile removed in favor of TargetBinary as it isn't really an ObjectFile only anymore. (Follows underlying changes in LLVM and the LLVM-C APIs)
* Removed  DebugInfoFlags values no longer present in underlying LLVM definitions
   - DebugInfoFlags.BlockByrefStruct
   - DebugInfoFlags.MainSubProgram
   - DebugInfoFlags.Trivial
* DiBuilder.CreateTypedef() now has an alignInBits parameter
(For more details see release notes)

## Other changes
* Added validation of input YAML with warnings for redundant or missing references
* Updated license info to LLVM's new lic.
* Fixed sample Kaleidoscope parser AST to corrrectly capture extern status of prototypes
* replaced extension LibLLVM* extension functions with new official LLVM* functions
* Added marking of deprecated functions in the interop API rather then deleting them outright, in case consumers are using it directly
* Added Kind property to AtomicRMW instructions
* Added IsWeak property to AtomicCmpXchg instructions
* Added support for the Freeze instruction
* Added additional Basic block insert/append methods
* Added support for creating macro files and macros to DebugInfoBuilder
* Removed C#8 features from bindings generator and forced project to framework defaults. This prevents hard to track compile/runtime fails if the language features require runtime support since the CppSHarp libs don't yet work on anything but net47
* Fixed handling of unsafe types in bindings generator
* Made conversion of pointer to IntPtr explicit so that functions returning pointers are easier to detect
* Updated type printer to not convert all pointer types to IntPtr so that conversion is explicit.
* added new !Unsafe (and corresponding class YamlUnsafeReturn) to the configuration to explicitly allow unsafe return types on functions requiring them. (This suppresses the validation error for the specified function)
* Updated config file with APIs requiring updates based on these changes
* Updated DIFile to use official LLVM functions to get property values
* Corrected nullability of scopes in Debug information
* Removed more redundant LibLLVM* functions and replaced with official LLVM* Functions
* Added more complete support for GlobalIFuncs, including module enumeration
* removed dead code from tutorial samples
* re-worked build scripts in prep for building llvm libs directly
* Moved to a common project/repo neutral module to leverage common functions across repos in general
* updated all the scripts to leverage new common module
* Increased strictness level to help catch bugs in the scripts earlier
* Updates for nullability and deprecated functions
* Nuget updates
* Added function pointer typedef (delegates) to the checks and marshaling support to ensure they are generated with a usable signature

* Ran solution wide cleanup to fix style of refactored code. (#163)

* Ran solution wide cleanup to fix style of refactored code.
* Fixed common build to auto opt-in to module install on automated builds
* Removed force parameter from Find-VSInstance
Shifted to testing for EnvVar instead)
* Corrected multiple path names for hashtable indexing
* added llvm_10 branch to build YAML to allow validation of in progress work

* Update samples for v10 (#165)

- updated main program of Kaleidoscope samples to better use existing reactive pipeline support. (Cleans up construction of the pipeline)
- Updated return type of the Generate method to use a new Optional<T> to indicate if a value was generated or not, instead of using a null value (or assuming the default value of a value type was never valid)

* Updating Kaleidoscope samples (#166)

* Replaced use of Observalbe with AsyncEnumerator as it is a more familiar flow and makes more sense for the REPL loops. This does add a bit more code to the sample program itself, but makes the error handling, parsing and generation more obvious.
* Added ErrorNode to the AST so that errors are recorded in tho the AST instead of thrown as an exception. (The AST and parsing no longer throw errors except for unexpected runtime states (Not user input/syntax errors))
* Simplified error handling and code generator return types to use OptionalValue<T> instead of null references etc. to indicate the operation completed but has no new data.
Added a unit test project (Currently empty) to flesh out unit testing of the samples to aid in validating their state and provide greater coverage of the core library itself.
* Major refactoring of Kaleidoscope parser and grammar libraries
   - The parser is now entirely in the grammar assembly and the ANTLR support is internal to that library. (e.g. the use of ANTLR is encapsulated in the assembly as an implementation detail)

* Test kaleidoscope (#167)

* Re-factored Kaleidoscope and enabled testing of codegen
* Kaleidoscope runtime now includes a generalized REPL abstract base class that eliminates a lot of duplicated code for each sample.
* Shifted to a simpler synchronous IEnumerable as the Async adds complexity and potential problems with threading and LLVM thread unsafe Contexts
* Added tests to at least run the sample language files through to ensure code gen doesn't blow up. (The actual output isn't validated yet but validating it doesn't crash is a step forward).

* * Simplified library init
* Updated doc comments on limitation of one init per process (ever)
* Added safer dispose to OrcJit as finalizer is allowed to run on a type where the constructor never did In particular if the constructor is called but fails to complete due to an exception, the finalizer is still called!

* Corrected name of  *Add*LowerAtomic transform method (#168)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant