summaryrefslogtreecommitdiff
path: root/src/jit/valuenumfuncs.h
AgeCommit message (Collapse)AuthorFilesLines
2018-11-19Make type comparisons more general purpose (#20940)Michal Strehovský1-0/+3
This has two parts: ## Part 1 CoreRT represents native type handles differently from CoreCLR - on CoreCLR, `RuntimeTypeHandle` is a wrapper over `RuntimeType` and RyuJIT is aware of that. On CoreRT, `RuntimeTypeHandle` wraps the native type handle, not a `RuntimeType`. The knowledge is hardcoded in importer when importing the sequence "ldtoken foo / call Type.GetTypeFromHandle" - importer just removes the call and bashes the result of ldtoken to be a reference type. CoreRT had to avoid reporting `Type.GetTypeFromHandle` as an intrinsic because of that. I'm adding another helper that lets RyuJIT avoid hardcoding that knowledge. Instead of just bashing the return type, we swap the helper call. ## Part 2 Native type handle equality checks need to go through a helper, unless the EE side says it's okay to compare native type handles directly.
2018-10-05Full support for exception sets in value numbering.Brian Sullivan1-7/+6
New method that add exception sets: fgValueNumberAddExceptionSet - fgValueNumberAddExceptionSetForIndirection - fgValueNumberAddExceptionSetForDivision - fgValueNumberAddExceptionSetForOverflow - fgValueNumberAddExceptionSetForCkFinite Refactoring work added methods: VNEvalShouldFold - method to decide if constant folding should be performed EvalUsingMathIdentity - Uses math identities to simplify value number exoressions Renamed fgValueNumberHelperMethVNFunc to fgValueNumberJitHelperMethodVNFunc Removed the suffixes from the method headers comments
2018-09-13Value Number Enhancements:Brian Sullivan1-19/+32
Revise the exeception gernerating value number functions: VNF_OverflowEXc, VNF_CastOvf, VNF_ARithmeticExc, VNF_DivideByZeroExc and ConvertOverflowExc added support methods for VNNormalValue Extended GetVNGuncForOper to support overflow operations and additional unsigned operations: And added value number functions for - unsigned comparisons, unsigned add, sub and mul - overflow add, sub, mul New method: VMCheckAscending to validate that exception sets maintain the ascending ordfer property. New method: VMExcSetIntersection and VMExcIsSubset Changed the constant folding logic in VNForFunc to avoid folding when the operation will unconditionally throw when folded. Explicitly specialize some EvalOp<> calls Added several new method headers comments in ValueNum.cpp Clear the unsigned flag when bashing nodes into GT_COMMA or GT_NOP nodes Removed GT_NOP and GT_COMMA cases from GetVNFuncForOper Added enum VNOperKind Added support for the unsigned multiply VNFunc used on 32-bit target
2017-12-13Adding valuenum support for acosh, asinh, atanh, and cbrtTanner Gooding1-0/+4
2017-11-05Remove unused VNF_DIV_UN and VNF_MOD_UNMike Danes1-2/+0
Integer division operators do not use GTF_UNSIGNED. There are distinct unsigned operators (GT_UDIV and GT_UMOD) and VN already handles those directly.
2017-08-10JIT: modify box/unbox/isinst/castclass expansions for fast jitting (#13188)Andy Ayers1-0/+1
When the jit is generating code in debug/minopts/rare-block modes, we'd prefer it to generate code more quickly and worry less about overall generated code performance. Generally speaking smaller intermediate and final code should correlate well with faster jitting. This change alters the expansions of box, unbox, isinst, and castclass when generating code for minopts, debug, or in rarely run blocks. In such modes the jit estimates whether an inline sequence or general helper call would result in more compact code, and then chooses the smaller sequence. This reduces generated code size around 2.5% in a variety of scenarios, and roughly translates to a 1.5% improvement in time spent jitting. Similar strategies can be applied to other complex operations during importation. That work is forthcoming.
2017-02-13Value number TypeHandleToRuntimeType helperJoseph Tremoulet1-0/+1
This is a pure helper w/o side-effects, so add it to the lists of tractable helpers in value-numbering; this allows redundant calls to be CSEd, and fixes #9552 so we can again optimize away type checks on type parameters in generic code (a not-infrequent pattern).
2017-02-08Value-number `ByrefExposed` memory and loadsJoseph Tremoulet1-0/+2
Teach value numbering to keep track of the current value number for `ByrefExposed` memory, updating it appropriately at relevant stores. Introduce a new VN operator `ByrefExposedLoad`, used for loads of address-exposed locals and loads by indirs that don't have more specific value numbers, which is a function of the current `ByrefExposed` memory VN and the pointer VN. This allows loop hoisting and CSE to recognize redundant loads via byrefs when there are no intervening stores. Fixes #7903.
2017-02-08Introduce `MemoryKind` abstractionJoseph Tremoulet1-4/+4
Re-cast the notion of "heap" (in liveness, SSA, and value-numbering) as one of potentially many `MemoryKind`s, called `GcHeap`. Update names, comments, data structures, and signatures as appropriate to parameterize relevant data/methods over `MemoryKind`. This change is a no-diff refactoring, and currently `GcHeap` is the only `MemoryKind`. Generally, codepaths which will generically need to process all `MemoryKinds`s (initializing, dumping, dataflow propagation) now iterate over all `MemoryKinds`, and codepaths which are sensitive to the semantics of the specific `MemoryKind` (def/use identification in liveness and value numbering) are changed to specifically operate on `MemoryKind::GcHeap`. One notable exception is that `lvMemoryPerSsaData` and `CountForMemoryDef` are *not* parameterized over `MemoryKind`; there's a single "space" of SSA defnums for memory defs (though the same tree can incur different defs for different memory kinds [in which case their defnums will differ]), to facilitate subsequently sharing SSA nodes across memory kinds when appropriate.
2016-11-15Fix value numbering for FieldSeqStore::NotAField.Pat Gavlin1-1/+2
Before this change, value numbering produced the same value number for each occurrence of `FieldSeqStore::NotAField`. This semantics is not logically consistent with the semantics of `NotAField`, however: `NotAField` indicates that we cannot reason about the address expression that it annotates, therefore we cannot reason about the value stored at the corresponding location. A recent change to admit the VN for `NotAField` in `ExtendPtrVN` exposed SBCG due to this mismatch in semantics: distinct array elements were assigned the same value number because each had the same base coupled with the `NotAField` VN. This change revises the representation of `NotAField` during value numbering: instead of reusing the same value number for each occurrence of `NotAField`, each occurrence is instead assigned a new, unique value number. These value numbers are represented using a new chunk attribute to retain the ability to decide whether or not a value number represents `NotAField` without the use of a more heavyweight map (e.g. a `VNMap`). Fixes #8133.
2016-10-26Fix value numbering of ReadyToRunGenericStaticBaseMichal Strehovský1-1/+1
Fixes dotnet/corert#2080.
2016-10-17helper for corertSergey Andreenko1-0/+1
Helper to get ready to run, shared, generic, static base.
2016-08-11Reformat jit sources with clang-tidy and formatMichelle McDaniel1-3/+2
This change is the result of running clang-tidy and clang-format on jit sources.
2016-07-29Massage code for clang-formatMichelle McDaniel1-1/+2
This change starts the process of updating the jit code to make it ready for being formatted by clang-format. Changes mostly include reflowing comments that go past our column limit and moving comments around ifdefs so clang-format does not modify the indentation. Additionally, some header files are manually reformatted for pointer alignment and marked as clang-format off so that we do not lose the current formatting.
2016-03-04Improvements for ReadyToRun helpers in JIT value numbering.Eugene Rozenfeld1-1/+5
The following ReadyToRun helpers are now treated similarly to their normal counterparts in value numbering: CORINFO_HELP_READYTORUN_NEW CORINFO_HELP_READYTORUN_NEWARR_1 CORINFO_HELP_READYTORUN_ISINSTANCEOF CORINFO_HELP_READYTORUN_CHKCAST CORINFO_HELP_READYTORUN_STATIC_BASE In particular, this allows CSE-ing calls to the last 3 of the above helpers when possible. #3281 is an issue for CORINFO_HELP_READYTORUN_STATIC_BASE. Compiler::fgValueNumberHelperCallFunc is refactored to reduce code duplication. Closes #3281.
2016-01-27Update license headersdotnet-bot1-4/+3
2015-12-11Port of all JIT changes for .NET Framework 4.6.1 changesBrian Sullivan1-1/+14
http://blogs.msdn.com/b/dotnet/archive/2015/11/30/net-framework-4-6-1-is-now-available.aspx .NET Framework list of changes in 4.6.1 https://github.com/Microsoft/dotnet/blob/master/releases/net461/dotnet461-changes.md Additional changes including - Working ARM64 JIT compiler - Additional JIT Optimizations o Tail call recursion optimization o Array length tracking optimization o CSE for widening casts o Smaller encoding for RIP relative and absolute addresses in addressing modes o Tracked Local Variable increased to 512 o Improved handling of Intrinsics System.GetType() o Improved handling of Math intrinsics - Work for the X86 Ryu-JIT compiler [tfs-changeset: 1557101]
2015-02-25FI from $/DevDiv/FXMain to $/DevDiv/FX/Product/ProjectK **FI_LABEL=22625.00**dotnet-bot1-1/+3
[tfs-changeset: 1421297]
2015-01-30Initial commit to populate CoreCLR repo dotnet-bot1-0/+123
[tfs-changeset: 1407945]