Age | Commit message (Collapse) | Author | Files | Lines |
|
Add additional check for the GT_UNSIGNED flag
+ Ran clang-format
+ Code review feedback, use IsUnsigned()
|
|
|
|
|
|
|
|
|
|
* Support for Arm64 Vector ABI
Extend HFA support to support vectors as well as floating point types.
This requires that the JIT recognize vector types even during crossgen,
so that the ABI is supported consistently.
Also, fix and re-enable the disabled Arm64 Simd tests.
Fix #16022
|
|
|
|
|
|
|
|
Create a new tree with const val and attach side-effects to it.
Extract common code and delete returns in the of the switch.
|
|
Currently compiletion will fail with an assert because of `optPrepareTreeForReplacement`.
|
|
|
|
* Extract `impAppendStmt` and `impExtractLastStmt`.
* Delete `BEG_STMTS` fake stmt.
Use new functions to keep the list updated.
* Retype `impTreeList` and `impTreeLast` as statements.
Rename `impTreeList` and `impTreeLast` to show that they are statements.
* Fix fields that have to be stmt.
* Start using GenTreeStmt.
Change `optVNAssertionPropCurStmt` to use GenTreeStmt.
Replace `GenTree* stmt = block->bbTreeList` with `GenTreeStmt* stmt = block->firstStmt()`.
Save results of `FirstNonPhiDef` as `GenTreeStmt`.
* Replace do-while with for loop.
* Change type inside VNAssertionPropVisitorInfo.
* Delete unused args fron `optVNConstantPropOnTree`.
* Update fields to be stmt.
Update optVNConstantPropCurStmt to use Stmt.
Change `lvDefStmt` to stmt.
Update LoopCloning structs.
Update `optDebugLogLoopCloning`.
Make `compCurStmt` a statement.
Update declaration name in `BuildNode`.
* Clean simple cpp files.
Clean valuenum.
Clean ssabuilder.
Clean simd.
Clean optcse.
Clean loopcloning.
Clean copyprop.
Clean optimizer part1.
* Start cleaning importer, morph, flowgraph, gentree.
* Continue clean functons.
Clean assertionprop.
Clean morph.
Clean gentree.
Clean flowgraph.
Clean compiler.
Clean rangecheck.
Clean indirectcalltransofrmer.
Clean others.
* Create some temp stmt.
* Delete unnecessary noway_assert and casts.
* Init `impStmtList` and `impLastStmt` in release.
* Response review 1.
|
|
* Clean `assertionprop.cpp`.
* Clean `codegencommon.cpp`.:
* Clean `codegenlinear.cpp`.
* Clean `compiler.cpp`.
* Clean `earlyprop.cpp`.
* Clean `gschecks.cpp`.
* Clean 'lclvars.cpp`.
* Clean `jiteh.cpp`.
* Clean `liveness.cpp`.
* Clean `hashbv.cpp`.
* Clean `gcinfo.cpp`.
* Clean `optimizer.cpp`.
|
|
For calls to isinst helpers, morph may rearrange the order of args on the late
arg list, so examine the operands to ensure the right ones are passed into the
assertion creation code.
Added simplified test case.
Closes #23039.
|
|
The ref count update traversal in the optimizer is not doing anything,
so remove it. This was overlooked when we changed away from incremental
updates in #19345.
Also: fix up comments and documentation to reflect the current approach
to local var ref counts.
|
|
It should use the same VN that `optVNConstantPropOnTree` uses.
Without this fix `optVNConstantPropOnTree` was doing nothing.
|
|
When we have a non-null fact about a byref, we try to find the corresponding
ref and generate an assertion about the ref. Then it can be used on byrefs if the offset is not too big.
We use both trees and value numbers to find the ref. When the ref wasn't found we bailed on generating
the assertion.
I found that we get a number of good diffs if we generate assertions for byrefs when refs can't be found
so this change enables that.
|
|
Eliminate most cases where an OBJ or BLK node is required for SIMD
values. The exception is the case where a value produced by an intrinsic
(SIMD or HWIntrinsic) is used as an argument but the argument is of a
different SIMD type (e.g. a different baseType),
|
|
First, evaluate the actual index before invoking the underlying int indexer,
so that the jit doesn't think the span is address taken.
Second, improve the jit's ability to remove some redundant comparisons like
those that arise in computing the actual index.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function is relatively expensive due to the many checks it does. Adding an LclVarDsc "in SSA" bit that is set during SSA construction by calling fgExcludeFromSsa only once per variable results in 0.35% drop in instructions retired.
Most of the checks done in fgExcludeFromSsa are implied by lvTracked and they could probably be converted to asserts. But lvOverlappingFields is not implied by lvTracked so even if all redundant checks are converted to asserts fgExcludeFromSsa still needs 2 checks rather than just one.
Incidentally, this difference between tracked variables and SSA variables results in SSA and value numbers being assigned to some variables that are actually excluded from SSA - SsaBuilder::RenameVariables and fgValueNumber assign numbers to all live in fgFirstBB variables that require initialization without checking fgExcludeFromSsa first. Structs with overlapping fields are not common but properly excluding them is still enough to save 0.15% memory when compiling corelib.
- Replace calls to fgExcludeFromSsa with calls to lvaInSsa (the old name is kind of weird, it has nothing to do with the flow graph and "exclude" results in double negation)
- Move fgExcludeFromSsa logic to SsaBuild::IncludeInSsa and use it to initialize LclVarDsc::lvInSsa for all variables
- Change RenameVariables and fgValueNumber to call lvaInSsa before assigning numbers to live in fgFirstBB variables
|
|
|
|
Eliminate duplicate SSA number bookkeeping
|
|
We use the following format when print the BasicBlock number: bbNum
This define is used with string concatenation to put this in printf format strings
|
|
We use a unique prefix character when printing value numbers in dumps: i.e. $1c0
This define is used with string concatenation to put this in printf format strings
|
|
Remove almost all of the code in the jit that tries to maintain local ref
counts incrementally. Also remove `lvaSortAgain` and related machinery.
Explicitly sort locals before post-lower-liveness when optimizing to get the
best set of tracked locals.
Explicitly recount after post-lower liveness to get accurate counts after
dead stores. This can lead to tracked unreferenced arguments; tolerate this
during codegen.
|
|
* Change gtExtractSideEffList to use GenTreeVisitor
The tree traversal logic in gtExtractSideEffList is basically an incomplete duplicate of GenTreeVisitor's traversal logic. It lacks handling for GT_ARR_ELEM and GT_ARR_OFFSET so if this are encountered any side effects their children may have are silently dropped.
In addition, side effect ordering was not always preserved. The comma list is built by prepending nodes to it so side effects have to be visited in reverse execution order. The old code did this only for simple opers, for special nodes such as GT_ARR_BOUNDS_CHECK normal execution order was used.
This actually complicates a bit the GenTreeVisitor implementation as side effects need to be first stored in an array. The number of side effects is usually small (<= 4) so this shouldn't be a problem.
* Use GTF_SIDE_EFFECT in optPrepareTreeForReplacement
Assertion propagation doesn't have any way to ensure that it is safe to remove class constructor calls so GTF_PERSISTENT_SIDE_EFFECTS_IN_CSE should not be used here.
Likewise, GTF_EXCEPT side effects must be preserved as well. VN doesn't always propagate exceptions so it's possible to end up with a tree that has a constant VN and contains exception side effects.
* Add tests for 18232
* CR feedback
|
|
Introduce a notion of state for local var ref counts and weighted ref counts.
Accesses and current state must agree.
State is invalid initially, enabled for an early period around bits of morph,
invalid again for a time, and then enabled normally once lvaMarkRefs is called.
Accesses normally specify RCS_NORMAL as the desired state, but in the accesses
of selected ref counts in morph, specify RCS_EARLY.
Revise how we decide if normal ref counting is active by changing
`lvaLocalVarRefCounted` into a method.
Update `gtIsLikelyRegVar` to not access ref counts when they're not in a valid
state.
Change weight APIs over to use `weight_t`.
|
|
During SSA construction SsaRenameState keeps a definition count for each variable in an array. But each variable has a lvPerSsaData array that does almost the same thing, count the definitions. "Almost" because lvPerSsaData is a JitExpandArray that tracks only the array size and not the number of elements actually stored in the array.
Replace JitExpandArray with purposely designed "array" that is in charge with allocating new SSA numbers and handles their intricacies - RESERVED_SSA_NUM, UNINIT_SSA_NUM and FIRST_SSA_NUM.
This also allows the removal of the allocator from the array. Allocating new SSA numbers happens only during SSA construction and it's reasonable to pass the allocator to AllocSsaNum rather than increasing the size of PerSsaArray and LclVarDsc.
|
|
This is a preparatory change for auditing and controlling how local
variable ref counts are observed and manipulated.
See #18969 for context.
No diffs seen locally. No TP impact expected.
There is a small chance we may see some asserts in broader testing
as there were places in original code where local ref counts were
incremented without checking for possible overflows. The new APIs
will assert for overflow cases.
|
|
* Corrected a few typos in the documentation and comments
* Corrected a few typos in the documentation and comments
* Corrected a few typos in the documentation and comments
* Corrected a few typos in the documentation and comments
* Corrected a few typos in the documentation and comments
* Corrected a few typos in the documentation and comments
|
|
* add test
* clean fgRemoveStmt a bit
* fix the issue (more like a workaround).
|
|
Remove JIT LEGACY_BACKEND code
All code related to the LEGACY_BACKEND JIT is removed. This includes all code related to x87 floating-point code generation. Almost 50,000 lines of code have been removed.
Remove legacyjit/legacynonjit directories
Remove reg pairs
Remove tiny instruction descriptors
Remove compCanUseSSE2 (it's always true)
Remove unused FEATURE_FP_REGALLOC
|
|
* jit sources: Each local pointer variable must be declared on its own line.
Implement https://github.com/dotnet/coreclr/blob/master/Documentation/coding-guidelines/clr-jit-coding-conventions.md#101-pointer-declarations
Each local pointer variable must be declared on its own line.
* add constGenTreePtr
* delete GenTreePtr
* delete constGenTreePtr
* fix arm
|
|
|
|
sizeof(arr) / sizeof(*arr) in clrjit. (#15474)
|
|
Use the existing accessor functions instead of checking the bits directly.
|
|
* Delete OldStyleClearD from flowgraph
BlockSetOps::Assign requires sets to have the same size, there is no an
additional risk to use ClearD then.
* delete OldStyleClearD from regalloc
regalloc doesn't create new local variables and doesn't change epoch.
* Delete OldStyleClearD from copyprop
CopyProp doesn't create new vars.
Also `VarSetOps::Assign(this, compCurLife, block->bbLiveIn); ` before
the loop requires epoch to be the same.
* Delete OldStyleClearD from assertionpop
Assertion prop doesn't change epoch.
* Delete OldStyleClearD from the emmit
Because it doesn't create new local vars.
* Delete declarations
|
|
Streamline JIT memory allocation
|
|
* Ifdef out legacy uses of GT_ASG_op
GT_ASG_op nodes are only generated when the legacy backend is used.
* Address feedback
* Cleanup gtOverflow/gtOverflowEx
|
|
These need to be modified to work directly with JIT's allocator(s) instead of going through IAllocator. It may also be useful to adjust these to account for the fact that the JIT never releases memory.
Besides, the JIT is the primary user of these classes - only ExpandArray(Stack) isn't used anywhere else and SimplerHashTable's only other user is the gcinfo library.
Renamed headers and classes to avoid potential conflicts with the old ones.
Also made the JIT's hash table behavior the default to avoid the need to specify it in hash table instantiations.
|
|
* Enable checking of GTF_EXCEPT and GTF_ASG flags.
fgDebugCheckFlags is modified to check that GTF_EXCEPT and GTF_ASG are set precisely when needed.
It's also modified to handle several special operators correctly.
fgAddrCouldBeNull is updated to check for handles, implicit byref locals, and stack byrefs.
OperMayThrow is modified to handle several operators correctly.
GTF_IND_NONFAULTING is reused on operations for which OperIsIndir() is true and on GT_ARR_LENGTH.
Various places in morph are updated to set side effect flags correctly.
gtUpdateSideEffects is re-written so that it's precise for GTF_ASG and GTF_EXCEPT
and conservatively correct for the other side effects. It's now called from more places
to keep the flags up-to-date after transformations.
NoThrow in HelperCallProperties is updated and GTF_EXCEPT flag is set on helper calls according to
that property.
optRemoveRangeCheck is cleaned up and simplified.
|
|
inArenaAllocator::allocateMemory
Immediately after this assert we roundUp to an pointer size allocation amount.
Stopped using two implementation of ArenaAllocator::allocateMemory
Instead we add ifdef DEBUG parts to the common version
Move the implementation of ArenaAllocator::allocateMemory to the header file
Fixed a couple of allocations in assertionprop to use CMF_AssertionProp so that we correctly
attribute which phase uses the memory being allocated.
Added range check for the array writes in Compiler::optMapComplementary
Removed the AlignUp to 4-byte in operator new and new[] in compiler.hpp
|
|
This reverts commit 0d390cceb7ab0c8a271afce315fe4456211fdc6c.
|