summaryrefslogtreecommitdiff
path: root/tests/src/JIT/opt/Inline
AgeCommit message (Collapse)AuthorFilesLines
2016-05-31Inliner: enable inlining of methods with cpblkAndy Ayers2-0/+88
Allow jit to inline methods with the cpblk IL opcode. Add a test case where such an inline happens.
2016-05-13Add budget check to RandomPolicyAndy Ayers1-1/+0
Prevents RandomPolicy from being overly aggressive with small methods that can lead to excessive inlining. Closes #4711. Undoes #4704.
2016-04-30Mark LotsOfInlines tests as optimization-sensitiveRuss Keldorph1-0/+1
The LotsOfInlines test times out under COMPlus_JitStress=1. (http://dotnet-ci.cloudapp.net/job/dotnet_coreclr/job/master/job/x64_checked_windows_nt_jitstress1/48/testReport/). This change disables it from running under JitStress modes that might affect optimizations required for it to run in reasonable time.
2016-04-15Inliner: use time budget to avoid excessive inliningAndy Ayers2-0/+116
Use the time budget and time estimates to stop inlining once the overall jit time increase estimate for the method is 10x the initial jit time estimate. This is implemented as part of `LegacyPolicy` and so can impact the current inline behavior. The budget is intentionally set quite high so that it only kicks in for very rare cases where the call tree below the root is deep and wide with many small methods. In extended testing on desktop this limit fires in exactly two cases, both HFA tests. In CoreCLR tests 12 of the HFA tests hit this limit. I've added a directed test case here that came from the original bug report. Closes #2472.
2016-04-06Set DebugType to PdbOnly for rel-mode IL testsAndy Ayers2-0/+2
Ensures that execution of these tests always invokes the jit's optimizer, regardless of the build configuration. See issue #4124.
2016-03-02Merge pull request #3405 from dagood/new-cliDavis Goodin42-42/+0
Upgrade dotnet CLI version, accumulated project.json changes
2016-03-02Remove RestorePackages = true from all test csproj's.Davis Goodin42-42/+0
Restore is performed once as a batch. csproj's share project.jsons, so restoring for each one was a race to update the lockfile.
2016-03-01Inliner: fix assert for multiple failure reasons when inliningAndy Ayers3-0/+122
Change #3436 added asserts that checked that the LegacyPolicy would not see multiple failing observations when inlining because we expect the inliner to fail fast when it hits the first bad observation. This change adds a test case that shows one example where we could get two failing observations, along with code changes to fix the issue. When an inlinee has invalid IL, an exception is raised and caught in `jitNativeCode`. The catch there sets the inline result to the never state. A failure code is propagated back to `fgInvokeInlineeCompiler` which redundantly sets the inline result to a failing state with a generic "something bad happened" observation. This second observation triggers an assert since the jit is inlining and the result is already known to be a failure. The fix is to check in `fgInvokeInlineeCompiler` if the inline result is already known to be in a failing state, and if so, forgo the new observation.
2016-02-04Some tests for caller/callee type mismatchesAndy Ayers6-0/+254
Ensure the jit can avoid or back out of inlines where types are mismatched. Remove some assertion checking that was looking at call actuals versus formals and instead let the newly added inline bail out handle cases where there are mismatches.
2016-01-27Update license headersdotnet-bot42-87/+129
2016-01-08Merge pull request #2550 from AndyAyersMS/InlineTreeAndy Ayers2-0/+84
Initial version of the inline tree
2016-01-07Initial version of the inline treeAndy Ayers2-0/+84
Extend `inlExpLst` to to describe the full inlining tree in a method, with a corresponding dump method. Add a top-level tree node to serve as the root of the tree. Set this as the inline context for all top-level expressions. Update the code that links in new nodes when there is a successful inline to build the tree links. Since the child list is extended by a prepend and candidates are currently visited in lexical (increasing "local" IL offset) order, the child list ends up reversed. The dumper prints the list entries from back to front to compensate so the tree display reflects lexical order. Capture IL offset to help in identifying call sites. Note this is incomplete and offets are often missing copies of the parent's offset. Will work on improving this subsequently. Update the depth check to return the depth. This is currently only used in diagnostic messages. Remove some unused inlining-related data members from the compiler class. Cache the `JitPrintInlinedMethods` config value and use it to dump the tree when inlining is done, if there were any inlines. The jit traditionally (and probably inadvertently) allowed one level of recursive inlining. Added a test case showing how this can happen. Because there is now a top-level inlining context, the recursion check can now potentially detect and block these recursive inlines. Support legacy behavior for now by setting `ixlCode` to `nullptr` in the top-level record. This change should be no diff. Sample output: ``` Inlines into Enumerable:Where(ref,ref):ref [IL=3] Error:ArgumentNull(ref):ref [IL=17] Error:ArgumentNull(ref):ref [IL=?] WhereArrayIterator`1:.ctor(ref,ref):this [IL=?] Iterator`1:.ctor():this [IL=?] Object:.ctor():this [IL=?] Environment:get_CurrentManagedThreadId():int [IL=?] Thread:get_CurrentThread():ref [IL=?] WhereListIterator`1:.ctor(ref,ref):this [IL=?] Iterator`1:.ctor():this [IL=?] Object:.ctor():this [IL=?] Environment:get_CurrentManagedThreadId():int [IL=?] Thread:get_CurrentThread():ref [IL=?] WhereEnumerableIterator`1:.ctor(ref,ref):this [IL=?] Iterator`1:.ctor():this [IL=?] Object:.ctor():this [IL=?] Environment:get_CurrentManagedThreadId():int [IL=?] Thread:get_CurrentThread():ref ``` Sample showing the recursive inline: ``` Inlines into Fact:factRx(int,int,int,int):int [IL=6] Fact:factRx(int,int,int,int):int ```
2016-01-06Remove some redundant inlining testsAndy Ayers79-7571/+0
2016-01-05Port more JIT tests.Pat Gavlin3-0/+125
Most of these tests were blocked on unnecessary usage of SerializableAttribute and Environment.ExitCode.
2015-12-10Import missing JIT tests.Pat Gavlin40-80/+80
These tests were thought to have been ported earlier.
2015-12-07Port more C# unit testsRichard L Ford82-0/+7735
The project files were generated automatically from a database and the source files scrubbed and formatted. In addition, some added tests are still failing. Issues were created for these and exclusions added, for windows and for non-windows.
2015-07-09Move CoreCLR to the modern build tools and dnxMatt Mitchell39-117/+156
This changes moves coreclr onto DNX (same version as corefx). Theoretically, this should allow these tests to target the desktop CLR. All of the old package.config files are gone and replaced with corresponding project.json files. The up front restore behavior is retained. Tests are now buildable individually, though not runnable in a similar fashion.
2015-06-30Speed up package resotre of JIT Test buildMatt Ellis40-84/+195
We spend a fair amount of time (six wall clock minutes on my machine) doing package restore for the JIT tests. This is because each project has its own packages.config file, so during the build we call nuget restore for each project. There are only four unique packages.config files for all these tests, so this change moves them to tests/src/JIT/config and updates the project files to consume them from there. This means during the build the `EnsureDependencies` target does not need to invoke nuget restore as often and the build is much faster as a result.
2015-06-24Refactor JIT test projects.Pat Gavlin40-23/+1756
This change replaces the template projects used for the ported JIT tests with a single project file per test. This refactoring is intended to clarify exactly which tests from the legacy testbed have been ported and what their dependencies are; this should make later reasoning about these tests more straightforward. This change also disables a number of innocuous warnings in the ported tests for hygenic purposes.
2015-04-22Add Inline test cases for JITBengu Li43-0/+5688
Add inlining optimizaiton test cases for JIT. Related proj, config, and sln files added and updated. Passed build, buildtest, runtest.