summaryrefslogtreecommitdiff
path: root/tests/src/JIT/Regression
AgeCommit message (Collapse)AuthorFilesLines
2017-11-08Added missing test JIT/Regression/CLR-x86-JIT/V1-M15-SP2/b124443/b124443.csBrian Sullivan4-0/+1020
Also added an IL version of this test for regression repro on CoreCLR
2017-11-06Add test case for jit dup stloc optimization (#14803)Andy Ayers2-0/+79
See #14784 for details.
2017-10-04Fix condition flags reuse optimization (#14323)mikedn2-0/+80
This optimization is not valid for unsigned LT/LE/GT/GE relops. Using the Carry flag this way indicates that the operation overflowed, not that the result is less than 0, that's impossible for unsigned integers. This is also not valid for signed LT/LE/GT/GE relops due to integer overflow.
2017-09-27Merge pull request #14207 from CarolEidt/Fix14028Carol Eidt2-0/+70
Handle GT_SIMD in GenTree::Compare
2017-09-26Handle GT_SIMD in GenTree::CompareCarol Eidt2-0/+70
Fix #14028
2017-09-23Make GitHub_14116 test work on 32 bitMike Danes1-1/+2
newarr expects int32 or native int on the stack. x64 JIT hapilly allows an int64 as well but the x86 JIT asserts. Also change the constant to 0xFFFFFFF1FFFFFFFF so OverflowException is thrown on 32 bit as well.
2017-09-22Merge pull request #14118 from rartemev/devdiv_491206Roman Artemev2-0/+104
Fixed return constant value cache on 32 bit VMs
2017-09-22Merge pull request #14117 from mikedn/earyprop-neg-lengthBruce Forstall2-0/+81
Don't early-propagate negative array lengths
2017-09-22Merge pull request #13167 from alpencolt/ryu-arm-remove-lea-0-offsetBruce Forstall2-0/+118
[RyuJIT/ARM32] Remove LEA[b+0]
2017-09-21fix checkLclVarSemantics (#14053)Sergey Andreenko2-0/+165
* extract CheckLclVarSemantics from CheckLIR. * add a test that shows the silent bad execution. * fix the checker. * add the test to the exclude list. * rename consumed to used
2017-09-21Fixed test return valueRoman Artemev1-1/+1
2017-09-21Added microtestRoman Artemev2-0/+104
2017-09-21[Jit] fgMorphCast does not reset GTF_ASG (#14102)Sergey Andreenko2-0/+175
add repro for DevDiv_495792. fix the issue.
2017-09-21Don't early-propagate negative array lengthsMike Danes2-0/+81
There's no need for that and if the negative array length is not representable in 32 bit we'll end up producing a GT_CNS_INT node that has TYP_INT and a 64 bit value. That's because the original type (always TYP_INT) of the GT_ARR_LENGTH is preserved when changing the node to GT_CNS_INT.
2017-09-21[RyuJIT] Regression test #13057Alexander Soldatov2-0/+118
LEA[b+0] was not eliminated on ARM which cause assertion on code generation
2017-09-14Merge pull request #13965 from CarolEidt/Fix13568Carol Eidt2-0/+194
Allow a RET_EXPR as a BYREF operand for SIMD intrinsics.
2017-09-14Update testCarol Eidt1-85/+86
2017-09-13Allow a RET_EXPR as a BYREF operand for SIMD intrinsics.Carol Eidt2-0/+193
Fix #13568
2017-09-13Renumber blocks before computing loop nestJoseph Tremoulet2-0/+98
The loop nest computation expects to be able to test block numbers for lexical inclusion, so do a renumbering pass first if blocks have been moved. Fixes #13919.
2017-09-12Remove redundant zero-initialization of struct temps with GC fields. (#13868)Eugene Rozenfeld2-0/+137
Remove redundant zero-initialization of struct temps with GC fields. Structs with GC pointer fields are fully zero-initialized in the prolog if compInitMem is true. Therefore, we don't need to insert zero-initialization for the result of newobj or for inlinee locals when they are structs with GC pointer fields and the basic bock is not in a loop.
2017-09-12fix stack depth in DevDiv_278523 test source code(#13912)Sergey Andreenko2-6/+4
2017-09-08Properly update GTF_{ASG,EXCEPT} in call morphing.Pat Gavlin2-0/+150
The former is only necessary if it is set on any of the call's arguments; the latter is necessary if the call may throw or if it is set on any of the call's arguments. Fixes DevDiv 491211.
2017-09-07Merge pull request #13821 from pgavlin/DevDiv487701_487702Pat Gavlin4-0/+306
Fix VSO 487701 and 487702.
2017-09-07Merge pull request #13817 from pgavlin/DevDiv487703Pat Gavlin2-0/+136
Do not remove NOPs used by calls.
2017-09-06Fix VSO 487701 and 487702.Pat Gavlin2-0/+2
Both of these issues stem from attempting to unassign a copied interval from the copied-to register and then reassigning the interval to the same. This corrupts some of the bookkeeping necessary to track whether or not the interval in the register needs to be spilled, and the RA ends up attempting to spill the interval being allocated even though it is not assigned a register.
2017-09-06Add tests for VSO 487701 and 487702.Pat Gavlin4-0/+304
2017-09-06Add a regression test.Pat Gavlin2-0/+136
2017-09-06Fix DevDiv_278523 test for r2r x86. (#13709)Sergey Andreenko3-29/+100
* separate sources into 2 files: for 32 and for 64.
2017-09-06Jit doesn't reload shift index if it was spilled to rcx. (#13757)Sergey Andreenko2-0/+162
Repro test. Fix and additional assert.
2017-09-01[RyuJIT/ARM32] Add regression testsAlexander Soldatov2-0/+79
Tests for #13056
2017-08-29Check for new blocks after `entry`Joseph Tremoulet1-0/+88
Loop construction has a check for the case that an in-loop block has a `bbNext` block that is a new block but not visited in the loop flow walk; make sure that check fires for `entry` as well as other loop blocks. Fixes #13507.
2017-08-28Fix bad cast morphing (#13429)mikedn2-0/+78
fgMorphCast thinks that casting a i1 value to i2 via conv.ovf.i2.un is a widening conversion and removes the overflow check. But this is in fact a narrowing conversion because i1 is implicitly sign extended to i4 and then i4 is treated as u4. Going from i4 to u4 overflows for negative values so we can't treat the source type of the cast as i1, it has to be u4. Of course, the existing code works fine if the source type is unsigned. Going from u1 to i4 and then to u4 never overflows so it's safe to treat the source type as u1.
2017-08-26Merge pull request #13411 from pgavlin/RepriTestsPat Gavlin828-3560/+2835
Reprioritize tests to improve inner-loop throughput.
2017-08-25Do not devirtualize indirect calls (#13561)Michal Strehovský2-0/+86
I'm seeing the affected code take the `impDevirtualizeCall` code path with `CT_INDIRECT` calls. `gtCallMethHnd` is a `GenTreePtr` in that case (it's a union) and passing that as as `CORINFO_METHOD_HANDLE` leads to bad things.
2017-08-22Merge pull request #13487 from mikedn/switch-temp-typeJoseph Tremoulet2-0/+58
Fix incorrect switch temp lcl type
2017-08-19Fix incorrect switch temp lcl typeMike Danes2-0/+58
2017-08-17Lay out loop bodies contiguouslyJoseph Tremoulet2-0/+453
Rearrange basic blocks during loop identification so that loop bodies are kept contiguous when possible. Blocks in the lexical range of the loop which do not participate in the flow cycle (which typically correspond to code associated with early exits using `break` or `return`) are moved out below the loop when possible without breaking EH region nesting. The target insertion point, when possible, is chosen to be the first spot below the loop that will not break up fall-through. Layout can significantly affect the performance of loops, particularly small search loops, by avoiding the taken branch on the hot path, improving the locality of the code fetched while iterating the loop, and potentially aiding loop stream detection. Resolves #9692.
2017-08-17Use conservative VN in CSE candidate const checkJoseph Tremoulet2-0/+73
The check in CSE is supposed to leave code alone that constant prop (done by VN-based Assertion Prop) is going to handle, but since that constant prop code only propagates based on conservative VN, the check in CSE needs to likewise use conservative VN to determine what to skip, or else neither phase will eliminate the redundancy. Fixes #6234.
2017-08-16Move less valuable tests to priority 1.Pat Gavlin828-3560/+2835
2017-08-09Merge pull request #12802 from pgavlin/VSO462269Pat Gavlin2-0/+179
Fix VSO 462269.
2017-08-09Fix VSO 462269.Pat Gavlin2-0/+179
When decomposing a long compare on 32-bit platforms, the operands to the decomposed compare must be sign- or zero-extended appropriately.
2017-08-07Fix VSO 471670.Pat Gavlin2-0/+144
If we remove a NOP during rationalize that is unused, we need to ensure that its operand is also marked as an unused value.
2017-07-31JIT: Fix value type box optimization (#13016)Andy Ayers16-0/+726
Boxing a value type produces a non-null result. If the result of the box is only used to feed a compare against null, the jit tries to optimize the box away entirely since the result of the comparison is known. Such idiomatic expressions arise fairly often in generics instantiated over value types. In the current implementation the box expands into two parts. The first is an upstream statement to allocate a boxed object and assign a reference to the boxed object to a local var known as the "box temp". The second is an expression tree whose value is the box temp that also contains an an encapsulated copy from the value being boxed to the payload section of the boxed object. The box node also contains a pointer back to the first statement (more on this later). In the examples being discussed here this second tree is a child of a compare node whose other child is a null pointer. When the optimization fires, the upstream allocation statement is located via the pointer in the box node and removed, and the entire compare is replaced with a constant 0 or 1 as appropriate. Unfortunately the encapsulated copy in the box subtree may include side effects that should be preserved, and so this transformation is unsafe. Note that the copy subtree as a whole will always contain side effects, since the copy is storing values into the heap, and that copy now will not happen. But the side effects that happen when producing the value to box must remain. In the initial example from #12949 the side effects in question were introduced by the jit's optimizer to capure a CSE definition. #13016 gives several other examples where the side effects are present in the initial user code. For instance the value being boxed might come from an array, in which case the encapsulated copy in the box expression tree would contain the array null check and bounds check. So removing the entire tree can alter behavior. This fix attempts to carefully preserve the important side effects by reworking how a box is imported. The copy is now moved out from under the box into a second upstream statement. The box itself is then just a trivial side-effect-free reference to the box temp. To ensure proper ordering of side effects the jit spills the evaluation stack before appending the copy statement. When the optimization fires the jit removes the upstream heap allocation as before, as well as the now-trivial compare tree. It analyzes the source side of the upstream copy. If it is side effect free, the copy is removed entirely. If not, the jit modifies the copy into a minimal load of the boxed value, and this load should reproduce the necessary side effects. The optimization is only performed when the tree shape of the copy matches expected patterns. There are some expected cases where the tree won't match, for instance if the optimization is invoked while the jit is inlining. Because this optimization runs at several points the jit can catch these cases once inlining completes. There is one case that is not handled that could be -- if the assignment part of the copy is itself a subtree of a comma. This doesn't happen often. The optimization is now also extended to handle the case where the comparision operation is `cgt.un`. This doesn't catch any new cases but causes the optimization to happen earlier, typically during importation, which should reduce jit time slightly. Generally the split of the box into two upstream statements reduces code size, especially when the box expression is incorporated into a larger tree -- for example a call. However in some cases where the value being boxed comes from an array, preserving the array bounds check now causes loop cloning to kick in and increase code size. Hence the overall size impact on the jit-diff set is essentially zero. Added a number of new test cases showing the variety of situations that must be handled and the need to spill before appending the copy statement. Fixes #12949.
2017-07-25Merge pull request #13035 from pgavlin/VSO468732Pat Gavlin2-0/+73
Treat byref-typed uses of int-typed lclVars as type int in LB.
2017-07-25Treat byref-typed uses of int-typed lclVars as type int in LB.Pat Gavlin2-0/+73
This is consistent with the behvaior of both JIT32 and RyuJIT. This resolves an assertion originating from the following scenario: 1. The input IL contains a lclVar of type `Foo*`, which the JIT imports as `TYP_I_IMPL` (which is `TYP_INT` in this case). 2. This lclVar is used as the `this` argument to a number of method calls. This is legal as per ECMA-335 section III.3.19 ("Correct CIL also allows a native int to be passed as a byref (&); in which case following the store the value will be tracked by garbage collection.") 3. All of the method calls to which this lclVar is passed as a byref are inlined. This produces many uses of the lclVar as a byref (i.e. we see nodes like `lclVar V06 byref` even though V06's varDsc has type int). 4. The lclVar is assigned a register `r`. At its first appearance--which is the first occasion in which it is loaded into this register--it is used as `TYP_BYREF`. When the code generator processes this appearance, it first sets the appropriate bit for `r` in `gcInfo.gcRegByrefSetCur` (`gcInfo.gcMarkRegPtrVal`, called by `genCodeForTree_REG_VAR1`) and then sets the appropriate bit for `r` in `regSet.rsMaskVars` (`genUpdateLife`). 5. The lclVar is used as `TYP_INT` as the operand to a `GT_RETURN` node. When the code generator processes this appearance, it attempts to update the GC-ness of `r` by calling `gcInfo.gcMarkRegPtrVal` (again via `genCodeForTree_REG_VAR1`). This function, though, explicitly excludes registers that contain live variables from its update, so `r` remains in `gcInfo.gcRegByrefSetCur` after this call. After calling `gcMarkRegPtrVal`, `genCodeForTree_REG_VAR1` calls `genUpdateLife`, which removes the the lclVar from `regSet.rsMaskVars`. 6. An assertion intended to verify that the only registers that are live after processing a statement are registers that contain lclVars fires, as `gcRegByrefSetCur` still contains `r`. Fixes VSO 468732.
2017-07-24Don't map P-DEP SIMD12 local vars to SIMD16 on x64Andy Ayers2-0/+74
P-DEP local vars are logically independent locals, but physically embeded in some structure with fixed layout. So they cannot be made larger. We already had safeguards for ths in place for x86 so extend these to kick in for x64 too. Also update Lowering's checker to account for the fact that some SIMD12s can persist in x64. Fixes #12950.
2017-07-17Add regression tests for #12761. #12761 was fixed by #12735.Eugene Rozenfeld2-0/+202
The bug was repro-ing on a dynamic method produced by Reflection::Emit. It's not possible to repro the bug on normal C# code because of C# definite assignment rules. This change adds a simple il regression test.
2017-07-13Mark shift helpers that produce an unused value as such.Pat Gavlin2-0/+115
Fixes VSO 462274.
2017-07-13Delete testRuss Keldorph2-591/+0
2017-07-11Fix for a bug in tail recursion elimination.Eugene Rozenfeld4-0/+132
Tail recursion elimination transforms a tail call into a loop. If compInitMem is set, we may need to zero-initialize some locals. Normally it's done in the prolog but the loop we are creating can't include the prolog. The fix is to insert zero-initialization for all non-parameter non-temp locals in the loop. Liveness phase will remove unnecessary initializations. We never hit this case with normal C# code since C# definite assignment rules ensure that there are no uninitialized locals in the generated msil. In the repro the method with tail recursion is a dynamic method and it has an uninitialized local.