summaryrefslogtreecommitdiff
path: root/tests/src/JIT
AgeCommit message (Collapse)AuthorFilesLines
2019-01-17Merge pull request #22022 from fiigii/reenabletestCarol Eidt11-0/+1664
Re-enable Avx.PermuteVar tests
2019-01-16Re-enable Avx.PermuteVar testsFei Peng11-0/+1664
2019-01-16Merge pull request #21997 from BruceForstall/FixFpRelativeInstructionsBruce Forstall2-0/+628
Fix two cases of FP-relative immediate offsets possibly not encodable
2019-01-16 Fix imm-operand encoding for SSE/AVX instructions (#21999)Fei Peng54-2557/+7719
* Move more SSE2 tests to the template * Improve Insert test template to involve more codegen situations * Fix imm-operand encoding for SSE/AVX instructions
2019-01-16Make JIT\superpmi\superpmicollect compatible with HelixEgor Chesakov3-34/+35
Related issue: https://github.com/dotnet/coreclr/issues/21698
2019-01-15Fix two cases of FP-relative immediate offsets not being checked for ↵Bruce Forstall2-0/+628
encodability For ARM32/ARM64, the immediate offsets in addressing modes have limited range that varies by instruction. A couple cases were not checking for that range, leading to generating potentially un-encodable instruction. In particular, the test case shows a case where a very large frame in a function with a stored generic context would fail on ARM64. There are no code diffs from this change for ARM64, except we sometimes get better assembly comments where the local variable referenced is annotated on the store instruction. For ARM32, the "secret stub param" is now stored using SP-relative addressing, not FP-relative, if possible (which we generally prefer in main function bodies).
2019-01-14Improvements for object stack allocation.Eugene Rozenfeld1-12/+80
This change enables object stack allocation for more cases. 1. Objects with gc fields can now be stack-allocated. 2. Object stack allocation is enabled for x86. ObjectAllocator updates the types of trees containing references to possibly-stack-allocated objects to TYP_BYREF or TYP_I_IMPL as appropriate. That allows us to remove the hacks in gcencode.cpp and refine reporting of pointers: the pointer is not reported when we can prove that it always points to a stack-allocated object or is null (typed as TYP_I_IMPL); the pointer is reported as an interior pointer when it may point to either a stack-allocated object or a heap-allocated object (typed as TYP_BYREF); the pointer is reported as a normal pointer when it points to a heap-allocated object (typed as TYP_REF). ObjectAllocator also adds flags to indirections: GTF_IND_TGTANYWHERE when the indirection may be the heap or the stack (that results in checked write barriers used for writes) or the new GTF_IND_TGT_NOT_HEAP when the indirection is null or stack memory (that results in no barrier used for writes).
2019-01-10Merge pull request #21804 from briansull/fix-unbox-optBrian Sullivan3-0/+172
Fix issue with devirtualization and tailcalls
2019-01-10Merge pull request #21928 from fiigii/fixMulxCarol Eidt3-0/+138
Don't optimize MultiplyNoFlags away
2019-01-10JIT: fix byte range used by RangeCheck (#21915)Andy Ayers2-0/+143
Range is -128 to 127, not -127 to 128.
2019-01-10Code Review feedbackBrian Sullivan1-1/+1
Change test priority to 0
2019-01-10Don't optimize BMI2 MultiplyNoFlags awayFei Peng3-0/+138
2019-01-10New test for DevDiv_754566Brian Sullivan3-0/+172
2019-01-10Merge pull request #21864 from fiigii/fixscalarmemCarol Eidt3-0/+339
Fix CRC32 instruction encoding on containment form
2019-01-10Add an exclusion for hugeexpr1 on arm32 under `JitOptimizationSensitive` . ↵Sergey Andreenko1-2/+3
(#21914)
2019-01-09Merge pull request #21779 from mazong1123/fix-19166-checkproj-optAndy Ayers12-36/+87
Check the optimize settings of JIT test projects.
2019-01-09Fix CRC32 instruction encoding on containment formFei Peng3-0/+339
2019-01-08Copy address-taken SIMD intrinsic (#21884)Carol Eidt2-0/+60
* Copy address-taken SIMD intrinsic This occurs, for example, when boxing the result of a SIMD intrinsic. This was being handled for the HW intrinsic case, but not the SIMD Vector intrinsics. Also, eliminate `OperIsSimdHWIntrisic` since it redundantly checks for the case of a SIMD result, even though it was always called in a context where the result is known to be a struct type. Fix #21854
2019-01-07Fixing ContainCheckHWIntrinsic to ensure that scalar integer operands are ↵Tanner Gooding2-0/+88
the appropriate size (#21641) * Fixing ContainCheckHWIntrinsic to ensure that scalar integer operands are the appropriate size * Adding a regression test for issue 21625 * Fixing IsContainableHWIntrinsicOp to use the containing node type (rather than the simd base type) for Scalar intrinsics * Fixing the containment check for `Sse41.Insert(V128<float>, V128<float>, byte)` * Cleaning up the isContainableHWIntrinsicOp logic in lowerxarch.cpp * Restrict containment to genActualType(baseType) * Formatting * Removing some comments and simplifying the supportsContainment checks for various HWIntrinsics that take a scalar operand * Applying formatting patch
2019-01-07Remove invalid test b21296 (#21507)Jan Vorlicek2-202/+0
This test was doing in-place modification of a managed string using unsafe code which breaks string interning.
2019-01-04Fixed the broken projects.Jingyu11-31/+1
2019-01-03Check the optimize settings of JIT test projects.Jingyu1-5/+86
This PR will output the projects that have mismatched optimize settings but won't fix them. This is part of tasks in #19166
2018-12-21Implement the remaining BMI1/2 intrinsic (#21480)Fei Peng26-15/+3077
* Add tests for BMI1/2 intrinsic * Implement the remaining BMI1/2 intrinsic * Fix emitDispIns for BMI instruction
2018-12-20Don't morph volatile IND(ADDR(LCL_VAR)) (#20843)mikedn2-0/+47
Besides the fact that volatile indirections aren't supposed to be removed doing so in this case results in incorrect code being generated. The GT_IND node has GTF_DONT_CSE set and this gets copied to the GT_LCL_VAR node. Later this prevents the insertion of a normalization cast because GTF_DONT_CSE on a GT_LCL_VAR node is assumed to mean that the variable address is being taken.
2018-12-20Merge pull request #21589 from CarolEidt/Fix21546Carol Eidt2-0/+111
Transform SIMD8 to FIELD_LIST if promoted
2018-12-18Transform SIMD8 to FIELD_LIST if promotedCarol Eidt2-0/+111
Fix #21546
2018-12-18Merge pull request #21567 from CarolEidt/Issue20657Carol Eidt2-0/+68
Test for #20657 SIMD byref bug
2018-12-17Switch to using resources in BenchmarksGames tests (#21554)Egor Chesakov15-246/+57
Embed the following test files as the resources in their corresponding test assemblies: * regexdna-input25.txt regexdna-input25000.txt in BenchmarksGame/regex-redux * knucleotide-input.txt knucleotide-input-big.txt in BenchmarksGame/k-nucleotide * revcomp-input25.txt revcomp-input25000.txt in BenchmarksGame/reverse-complement
2018-12-17Test for #20657 SIMD byref bugCarol Eidt2-0/+68
2018-12-16Merge pull request #21400 from BruceForstall/FixArm32FloatRangeBruce Forstall2-0/+452
Fix arm32 local variable references
2018-12-16Enable object stack allocation in R2R mode.Eugene Rozenfeld1-1/+0
This change modified the importer to create GenTreeAllocObj node for box and newobj instead of a helper call in R2R mode. ObjectAllocator phase decides whether the object can be allocated on the stack or has to be created on the heap via a helper call. To trigger object stack allocation COMPlus_JitObjectStackAllocation has to be set (it's not set by default).
2018-12-13Suppress warning of obsolete API (#21529)Aaron Robinson1-0/+2
2018-12-07Merge pull request #21361 from fiigii/x64testsCarol Eidt72-592/+1147
Improve hardware intrinsic tests
2018-12-05Fix arm32 local variable referencesBruce Forstall2-0/+452
Arm32 has different addressing mode offset ranges for floating-point and integer instructions. In addition, the ranges aren't too large. So in functions with a frame pointer, we try to access some variables using the frame pointer and some with the stack pointer, to expand the total number of variables we can access without allocating a "reserved register" just used for constructing large offsets. This calculation was incorrect for struct variables that contained floats, as float fields require calculating using the floating point range, but we were calculating using the variable type (struct), instead of the instruction type (floating-point). In addition, we were not correctly calculating the frame pointer range using the actual variable offset plus "within variable" offset (struct member offset). Added a test that covers some of these cases. Fixes #19537
2018-12-05Merge pull request #21322 from mikedn/div-small-intBrian Sullivan2-0/+80
Fix lclvar "cloning" in const division lowering
2018-12-04Add repro for `(reg2 == REG_NEXT(reg1)) || (reg2 == REG_LR)` assert in ↵Sergey Andreenko2-0/+79
`codegenarm64`. (#21344) * Add a repro. * Exclude the failing test. * fix formatting
2018-12-04Move more SSE2 intrinsic tests to templateFei Peng24-543/+1098
2018-12-04Remove redundant checks in test templatesFei Peng49-49/+49
2018-12-03Merge pull request #21264 from fiigii/x64onlyCarol Eidt100-965/+4495
Implement 64-bit-only hardware intrinsic
2018-12-03JIT: fix overly aggressive type propagation from returns (#21316)Andy Ayers2-0/+56
For quite a while now the jit has been propagating return types from callees to the return spill temp. However this is only safe when the callee has a single return site (or all return sites return the same type). Because return spill temps often end up getting assigned to still more temps we haven't seen this overly aggressive type propgagation lead to bugs, but now that we're tracking single def temps and doing more type propagation during the late devirtualization callback, the fact that these types are wrong has been exposed and can lead to incorrect devirtualization. The fix is to only consider the return spill temp as single def if the callee has a single return site, and to check that the return spill temp is single def before trying to propagate the type. Fixes #21295.
2018-12-01Fix lclvar "cloning" in const division loweringMike Danes2-0/+80
The existing code was creating new uses of existing variables using the type of the division operation instead of the type of the existing variable use. There is one rare case when this does not work properly: * if the variable is "normalize on load" (that implies that it is also a small int type variable) * and if the variable is previously assigned to such that a subrange assertion is generated * and if morph decides not to insert the load normalization cast due to the subrange assertion * and if the variable is not enregistered Then the assignment stores 2 bytes to the stack location but the uses generated by the division lowering code read 4 bytes because they have TYP_INT.
2018-11-30Migrate 64-bit-only intrinsic tests to new APIsFei Peng100-965/+4495
2018-11-28Fix ObjectStackAllocationTests on Linux under minoptsBruce Forstall1-2/+2
Fix the capitalization of COMPlus_JITMinOpts variable, which is case-sensitive on Linux. Fixes #21266
2018-11-26Merge pull request #21184 from mikedn/load-normBrian Sullivan2-0/+86
Fix normalize on load handling in assertion propagation
2018-11-25Add test for 18867Mike Danes2-0/+86
2018-11-23Don't assume objects don't escape in pure helpers.Eugene Rozenfeld1-4/+6
We can't assume objects don't escape in helpers marked as pure for the following reasons: 1. The helpers may call user code that may make objects escape, e.g., https://github.com/dotnet/coreclr/blob/c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/jithelpers.cpp#L2371 2. The helpers usually protect gc pointers with GCPROTECT_BEGIN() so the pointers are reported as normal pointers to the gc. Pointers to stack-allocated objects need to be reported as interior so they have to be protected with GCPROTECT_BEGININTERIOR(). 3. The helpers may cause these asserts in ValidateInner on stack-allocated objects: https://github.com/dotnet/coreclr/blob/c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/object.cpp#L723 https://github.com/dotnet/coreclr/blob/c94d8e68222d931d4bb1c4eb9a52b4b056e85f12/src/vm/object.cpp#L730
2018-11-21Disable object stack allocation verification under GCStress.Eugene Rozenfeld2-17/+40
ObjectStackAllocationTests use GC.GetAllocatedBytesForCurrentThread to verify object stack allocations. Under GCStress the vm may initiate additional heap allocations in GCHeap::StressHeap (see the call to 'pGenGCHeap->allocate' below). This change re-enables ObjectStackAllocationTests and updates then to not verify stack allocations under GCStress. It's useful to run the tests even without the verification to catch crashes, gc asserts, etc. ``` if (Interlocked::Increment(&OneAtATime) == 0 && !TrackAllocations()) // Messing with object sizes can confuse the profiler (see ICorProfilerInfo::GetObjectSize) { StringObject* str; // If the current string is used up if (HndFetchHandle(m_StressObjs[m_CurStressObj]) == 0) { // Populate handles with strings int i = m_CurStressObj; while(HndFetchHandle(m_StressObjs[i]) == 0) { _ASSERTE(m_StressObjs[i] != 0); unsigned strLen = (LARGE_OBJECT_SIZE - 32) / sizeof(WCHAR); unsigned strSize = PtrAlign(StringObject::GetSize(strLen)); // update the cached type handle before allocating SetTypeHandleOnThreadForAlloc(TypeHandle(g_pStringClass)); str = (StringObject*) pGenGCHeap->allocate (strSize, acontext); if (str) { str->SetMethodTable (g_pStringClass); str->SetStringLength (strLen); HndAssignHandle(m_StressObjs[i], ObjectToOBJECTREF(str)); } i = (i + 1) % NUM_HEAP_STRESS_OBJS; if (i == m_CurStressObj) break; } // advance the current handle to the next string m_CurStressObj = (m_CurStressObj + 1) % NUM_HEAP_STRESS_OBJS; } // Get the current string str = (StringObject*) OBJECTREFToObject(HndFetchHandle(m_StressObjs[m_CurStressObj])); if (str) { // Chop off the end of the string and form a new object out of it. // This will 'free' an object at the begining of the heap, which will // force data movement. Note that we can only do this so many times. // before we have to move on to the next string. unsigned sizeOfNewObj = (unsigned)Align(min_obj_size * 31); if (str->GetStringLength() > sizeOfNewObj / sizeof(WCHAR)) { unsigned sizeToNextObj = (unsigned)Align(size(str)); uint8_t* freeObj = ((uint8_t*) str) + sizeToNextObj - sizeOfNewObj; pGenGCHeap->make_unused_array (freeObj, sizeOfNewObj); str->SetStringLength(str->GetStringLength() - (sizeOfNewObj / sizeof(WCHAR))); } else { // Let the string itself become garbage. // will be realloced next time around HndAssignHandle(m_StressObjs[m_CurStressObj], 0); } } } Interlocked::Decrement(&OneAtATime); ```
2018-11-20Fix for #21011: propagate GTF_DONT_CSE on comma returnsEugene Rozenfeld2-0/+57
When a method returns a multi-reg struct, we set GTF_DONT_CSE on return local: https://github.com/dotnet/coreclr/blob/497419bf8f19c649d821295da7e225e55581cce9/src/jit/importer.cpp#L8783 Setting GTF_DONT_CSE blocks assertion propagation here: https://github.com/dotnet/coreclr/blob/9d49bf1ec6f102b89e5c2885e8f9d3d77f2ec144/src/jit/assertionprop.cpp#L2845-L2848 In the test we have a synchronized method so we change the return node to return a comma that include a call to HELPER.CORINFO_HELP_MON_EXIT. If the rightmost comma expression doesn't have GTF_DONT_CSE, assertion propagation is not blocked and we end up with this tree: ``` [000040] -----+------ /--* CNS_INT struct 0 [000043] --C-G+------ /--* COMMA struct [000036] --C-G+------ | \--* CALL help void HELPER.CORINFO_HELP_MON_EXIT [000032] L----+------ arg1 in x1 | +--* ADDR long [000031] ----G+-N---- | | \--* LCL_VAR ubyte (AX) V03 tmp1 [000033] -----+------ arg0 in x0 | \--* LCL_VAR ref V00 this [000041] -AC-G+------ * COMMA struct [000006] -----+-N---- | /--* LCL_VAR struct V01 loc0 [000039] -A---+------ \--* ASG struct (copy) [000037] D----+-N---- \--* LCL_VAR struct V05 tmp3 ``` Downstream phases can't handle struct zero return expressed as ``` [000040] -----+------ /--* CNS_INT struct 0 ``` The fix is to propagate GTF_DONT_CSE to the rightmost comma expression to block bad assertion propagation. Fixes #21011.
2018-11-20Fixing up some issues with the HWIntrinsic test templates (#21104)Tanner Gooding1472-6348/+16386
* Updating the VectorNotSupportedTest to throw on failure * Updating the HWIntrinsic test templates to check success on a per-scenario basis * Regenerating the templated HWIntrinsic tests
2018-11-19Add asserts for the types of the Span indexers. (#21037)Carol Eidt2-0/+78
Also, add a test for #20958