Age | Commit message (Collapse) | Author |
|
* Rewrite fgMorph(Copy/Init)Block.
* fix a last squash error.
* fix nits
|
|
Add more iterators compatible with range-based `for` syntax for various data structures. These iterators all assume (and some check) that the underlying data structures determining the iteration are not changed during the iteration. For example, don't use these to iterate over the predecessor edges if you are changing the order or contents of the predecessor edge list.
- BasicBlock: iterate over all blocks in the function, a subset starting not at the first block, or a specified range of blocks. Removed uses of the `foreach_block` macro. E.g.:
```
for (BasicBlock* const block : Blocks()) // all blocks in function
for (BasicBlock* const block : BasicBlockSimpleList(fgFirstBB->bbNext)) // all blocks starting at fgFirstBB->bbNext
for (BasicBlock* const testBlock : BasicBlockRangeList(firstNonLoopBlock, lastNonLoopBlock)) // all blocks in range (inclusive)
```
- block predecessors: iterate over all predecessor edges, or all predecessor blocks, e.g.:
```
for (flowList* const edge : block->PredEdges())
for (BasicBlock* const predBlock : block->PredBlocks())
```
- block successors: iterate over all block successors using the `NumSucc()/GetSucc()`, or `NumSucc(Compiler*)/GetSucc(Compiler*)` pairs, e.g.:
```
for (BasicBlock* const succ : Succs())
for (BasicBlock* const succ : Succs(compiler))
```
Note that there already exists the "AllSuccessorsIter" which iterates over block successors including possible EH successors, e.g.:
```
for (BasicBlock* succ : block->GetAllSuccs(m_pCompiler))
```
- switch targets, (namely, the successors of `BBJ_SWITCH` blocks), e.g.:
```
for (BasicBlock* const bTarget : block->SwitchTargets())
```
- loops blocks: iterate over all the blocks in a loop, e.g.:
```
for (BasicBlock* const blk : optLoopTable[loopInd].LoopBlocks())
```
- Statements: added an iterator shortcut for the non-phi statements, e.g.:
```
for (Statement* const stmt : block->NonPhiStatements())
```
Note that there already exists an iterator over all statements, e.g.:
```
for (Statement* const stmt : block->Statements())
```
- EH clauses, e.g.:
```
for (EHblkDsc* const HBtab : EHClauses(this))
```
- GenTree in linear order (but not LIR, which already has an iterator), namely, using the `gtNext` links, e.g.:
```
for (GenTree* const call : stmt->TreeList())
```
This is a no-diff change.
|
|
If we have PGO data and the dominant non-default switch case has more than
55% of the profile, add an explicit test for that case upstream of the switch.
We don't see switches all that often anymore as CSC is quite aggressive about
turning them into if-then-else trees, but they still show up in the async
methods.
|
|
1. Introduce `COMPlus_JitFgDumpPrePhase`. This is analogous to the existing
`COMPlus_JitFgDumpPhase`, but to dump before a phase, not after. It takes a
set of short phase names, and dumps the flow graph before each of those phases.
E.g., to dump both before and after just loop cloning, you don't need to figure
out which phase comes before loop cloning, you can specify:
```
set COMPlus_JitDumpFgPhase=LP-CLONE
set COMPlus_JitDumpFgPrePhase=LP-CLONE
```
2. Interpret array length node type in BBJ_COND blocks, e.g., `V01.Length <= V03`.
|
|
* Replaces all BOOL to bool in RyuJIT
Replaced all Windows' BOOL to bool in RyuJIT except
for WIN API related cases.
Fix #48317
* Replaced `TRUE` and `FALSE` constants
Replaced `TRUE` with `true` and `FALSE`
with `false` constants in RyuJIT except
Windows-specific cases.
* A couple of BOOLs replaced to bool
* Format issue fixed
Formatting patch applied
according to the instruction.
|
|
* Introduce enum for BasicBlock and loop flags
This gives a better debugging experience in Visual Studio. It
also improves type checking: there were a few places still using
`unsigned` instead of `unsigned __int64` when manipulating
BasicBlock flags.
* Make sure debugreturn and contracts are disabled for the JIT build
* Convert GenTree flags, debug flags, and call flags to enums
* Remove bad GT_HWINTRINSIC copy/paste code from GenTree::GetRegSpillFlagByIdx
|
|
1. For conditional blocks, display a small summary of the branch taken path
of the block (namely, the JTRUE condition). This is currently very limited,
but could be expanded to additional cases as it proves useful (but it needs
to be very compact; you're expected to consult the JitDump for more details).
2. Optionally display both the bbNum and bbID as the block label. This makes
it easier to see which blocks remained the same through renames if comparing
flow graph displays from different phases. This is enabled by setting
`COMPlus_JitDumpFgBlockID=1`.
|
|
1. Do not include EH and Loop regions in the graph for inlinees. The
data required for them is not valid in the inlinee compiler.
2. Do not include Loop regions in phases starting with the rationalizer.
The loop table is not maintained, and decays, but we don't ever mark it
as invalid. This is an arbitrary point after which it seems to be
unmaintained (and can lead to asserts when using it).
3. Add the text "(inlinee)" to the function name in inlinee graph output,
to distinguish it.
4. Fix a bug where the block map was using incorrect block number count
for inlinees.
5. Fix a region insert bug when inserting a parent region after a child
region where they share the end block (but the parent start block is earlier
than the child). This happens in some EH region tables. Added some comments
about all the different forms of region that need to be handled.
6. Add a `Verify` function to validate the constructed region tree.
7. Stop adding removed loops to the output.
|
|
Instead, add and modify the appropriate preds when the mechanical
cloning is performed. This will preserve existing profile data
on the edges.
Contributes to #49030
No x86/x64 SPMI asm diffs.
|
|
* Flow graph "dot" graph output improvements
Added optional support for adding EH regions and loops in the loop table
to the ".dot" format flow graph display. To enable one or both of
these, use:
```
set COMPlus_JitDumpFgEH=1
set COMPlus_JitDumpFgLoops=1
```
Also, I added a config variable to allow disabling the use of "invisible"
edges that forces the graph to be in mostly lexical linear order in the layout.
To use this, use:
```
set COMPlus_JitDumpFgConstrained=0
```
(COMPlus_JitDumpFgConstrained=1 is the default.)
* Remove trailing newlines from block label
|
|
* Improve flowgraph xml/dot dumping
1. Decouple it from JitDump
2. Add some documentation, including a useful link to https://sketchviz.com/
3. Fix DUMP_FLOWGRAPHS Release build
4. Fix some xml dumping issues
5. Replace custom function pattern parsing with CONFIG_METHODSET ".contains" function
6. Make dot format the default (instead of xml)
Fixes #43712
* Code review feedback: use `getCalledCount`
|
|
|
|
Co-authored-by: Andy Ayers <andya@microsoft.com>
Co-authored-by: Sergey Andreenko <seandree@microsoft.com>
|
|
* Comments and cleanup for loop cloning
This is a no-diff change
Added various comments to document loop cloning.
Standardized and improved some logging.
Consolidated more loop cloning condition checking into
`optIsLoopClonable` that was previously in `optIdentifyLoopOptInfo`.
Replaced some `0` weights with `BB_ZERO_WEIGHT`.
Made FMT_BB use pervasive.
* Review feedback
Added FMT_LP formatting string.
Cached often-used `optLoopTable[loopInd]` expression.
Added `const` to many loop query member functions.
Added static `GenTree::OperIs(compareOper, oper, oper, oper...)`
functions for simplifying oper check expressions where the
compareOper isn't from a GenTree node `OperGet()`. (This doesn't
need to be part of GenTree, but it doesn't hurt, either.)
Added a few more comments.
* Fix static OperIs
Rename to StaticOperIs. It appears the compiler uses the wrong
template in some cases, but doesn't complain about duplicate
options, leading to run-time failures.
|
|
* Fix or disable warnings on latest VS dogfood
* Delete JIT local warning disables
|
|
* Add fgDebugCheckLoopTable()
* Minify some logging
* Add checking of the loop table to some phases
* Ignore removed loops in fgDebugCheckLoopTable
|
|
indirections (#47808)
* Added GTF_CALL_M_EXPANDED_EARLY to flag virtual calls that should be expanded early during fgMorph
Added COMPlus_JitExpandCallsEarly variable to enable virtual calls to be expanded early on a per method basis
Set opts.compExpandCallsEarly to true when we are optimizing and have COMPlus_JitExpandCallsEarly enabled
Update gtSetEvalOrder to also include the call->gtControlExpr
Update morph to call fgExpandVirtualVtableCallTarget when we are expanding early
Update lower to not call LowerVirtualVtableCall when we have already expanded it early
Modify CheckTreeId to print the duplicated gtTreeID before it asserts.
All tests are passing when using COMPLUS_JitExpandCallsEarly=*
Expand the Virtual Call target after we morph the args
Fix an inadvertent change in the GT_CALL weights
* Changed the default for Virtual calls to be expanded early in Morph
Use COMPlus_JitExpandCallsEarly=0 to disable and use old behavior
* Code Review feedback
Added comment stating the the isRelative code path is never executed
* Fixes for propagating gtControlExpr->gtFlags
* Fix a few code size regressions when we perform a tail call
* Tailcall lower fix
* Code Review changes
* Fixes for the TAILCALL_HELPER path for x86
* Address the Arm/Linux failure
|
|
Create a number of smaller files with cohesive sets of methods.
|