Adds DoTailCallOpt, TailCallMax as well as others mentiond in the
reader. Also includes the UseConservativeGC/DoInsertStatepoint
options used by the GC work.
This adds a place for us to keep milestones that will take a PR.
These milestones will be linked to out of the wiki for reference. For
additions open a github issue to start a conversation then PR an edit
that has the new milestone. When milestones are acheived strike through the txt.
39 inlining optimization test cases were added in CoreCLR repo in dotnet/coreclr#776.
3 of them have issue if run with LLILC, Inline_Handler, Inline_Vars, InlineThrow.
Exclude them in both powershell and python scripts. Issue dotnet#487
is created for investigation of the causes.
Point blocks created in the first pass might not yet have a spot for their
point available to insert them into the block list. This change:
1. adds tracking of whether the first pass is completed or not,
2. initializes the NodeOffsetListArray earlier so it will be available
when point blocks are craeted in readerPrePass,
2. during the first pass (and pre-pass), updates point block creation to call
fgAddNodeMSILOffset to ensure that an appropriate spot will be created
for it in fgReplaceBranchTargets, and
3. in replaceFlowGraphNodeUses (which gets called from
fgReplaceBranchTargets), moves the point node to the appropriate spot.
This change also fixes some blocks that are currently out-of-order:
1. Create endfinally blocks and unreachable continuation blocks as point
blocks (so the processing above will pick them up)
2. Add a PreviousNode parameter to makeFlowGraphNode, use it to keep the
tail block next to the ret block when we process ret.
This gets first-pass created point blocks in correct MSIL offset order
before we process them in the second pass. The checking in msilToIR is
updated to assert that the blocks are already in sorted order.
Also fix some stale comments around fgReplaceBranchTargets.
It's possible that while adding the fields to a struct we may complete the struct
due to circular type definitions. Detect that case and return the result right away.
We had an off-by-1 error in the allocation of the argument array.
Because of that we had an extra null argument in the helper call which
resulted in llvm verification failure when building Roslyn.
16 test cases were added under Directed\cmov in CoreCLR repo in dotnet/coreclr#766.
13 of them have issues if run with LLILC. Exclude them
in both powershell and python scripts. Issue #480
is created for investigation of the causes.
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.
Since we allow structs in SSA, the code is similar to that for loading
primitive types.
Change getPrimitiveAddress to getTypedAddress so that it can be used for
both primitive and non-primitive types.
This wraps LLVMBuilder->CreateCall, and will be where the logic goes that
instead creates an invoke with an appropriate exception edge if we're in a
protected region.
llilc_checkpass compares two test results, no matter summary or verbose,
and checks if any function was successfully jitted by LLILC in base result
but failed jitting in diff result.
If the check passed, the script return 0. In case of 0, it might have
jitted more functions in diff result than in base result. The two results
are not necessary the same in this case. Counting result is reported.
If the check failed due to newly failed function, return 1.
If the check failed due to unexpected reason, return negative numbers.
usage: llilc_checkpass.py [-h] -b BASE_RESULT_PATH -d DIFF_RESULT_PATH
optional arguments:
-h, --help show this help message and exit
required arguments:
-b BASE_RESULT_PATH, --base-result-path BASE_RESULT_PATH
full path to base result
-d DIFF_RESULT_PATH, --diff-result-path DIFF_RESULT_PATH
full path to diff result
Also this change includes some supporting changes in llilc_runtest
and applyfilter:
1. In llilc_runtest result normalization, perform a summary extraction on
verbose result and a renaming on summary result.
2. applyfilter is enhanced with summary extraction so that filtering
and summary extraction can be done at the same time without the
need to scan through result file twice.
3. Summary result renaming added in applyfilter
4. Introduce const module in for symbolic constatn return code
5. Default to single quote style. Python is a little tricky when double
quotes and single quotes are mixed.
6. Create required argument section in help for llilc_runtest and llilc_checkpass
7. Add more error and exception handling
8. Remove llvm verification failure from summary
Add calls to MONITOR_ENTER on entry to the method and MONITOR_EXIT on returns.
We can't catch exceptions yet; when we can we will need to add a try/fault for the entire method
so that we can call MONITOR_EXIT on unhandled exceptions.
We have a synchronized method in HelloWorld (System.IO.TextWriter+SyncTextWriter.WriteLine).
I verified that the generated IR looks correct. I also tested with a simple two-thread race that the
behavior of synchronized instance and static methods is as expected.
Getting the LLVM IR right here is not too hard. We're zeroing via the JIT helper since using LLVM's memset might lead to calls into the CRT.
Most of the challenge here is getting this IR properly lowered to machine code. I have some preliminary changes checked into LLVM for this already, and this change depends upon them.
To enable those changes we now use the CoreCLR environment when targeting windows. Thus the LLVM triple we use on windows is now actually a quad.
The LLVM work is incomplete so this only works at runtime if the localloc is small enough to stay within the guard page, but it handles all our simple test cases.
When including the header file for other purpose,
this often caused ambiguous name conflicts for other types.
By convention, I moved it to cpp file where it is used.
CoreCLR's COMPLUS_GCCONSERVATIVE flag tells the runtime to use
conservative when set. LLILC also used this flag to determine whether
the insertion and lowering of statepoint intrinsics are done.
With this change, steatpoints are inserted if the COMPLUS_INSERTSTATEPOINTS
switch is set, regardless of the COMPLUS_GCCONSERVATIVE flag.
This allows testing of LLILC Jit with statepoints inserted. That is, to
check that the code itself is still correct, regardless of the GC information.
Fix a check in GenIR::simpleFieldAddress that was allowing bad field indices for StructGEP.
Add NYIs for struct type mismatches.
Treat verification errors as compilation failures.
We don't want the LLVM dynamic loader to try and resolve external symbols by name. As things stand today, if jitted code contains external symbol references we have a bug in the jit.
This anticipates a change I'm about to make in LLVM where I enable the ability to resolve externals by name for x64 COFF RtDyld, since other LLVM clients need this.
Once both changes are in we'll get a somewhat clearer error message when Jitted code has an unsat, e.g.
`LLVM ERROR: Program used external function '__chkstk' which could not be resolved!`