Skip to content

PerfScore inconcistencies with memory accesses #49647

@pentp

Description

@pentp

In getInsExecutionCharacteristics there are three different ways used to calculate memory access latencies, used seemingly at random (except for special instructions like mov)

  • result.insLatency += ins_latency; - this seems the most logical option, e.g. INS_addsd
  • result.insLatency = max(ins_latency, result.insLatency); - looks incorrect to me, e.g. INS_add
  • result.insLatency not set if memAccessKind != PERFSCORE_MEMORY_NONE - incorrect, e.g. INS_aesdec

And a related question for insEvaluateExecutionCost - if memAccessKind == PERFSCORE_MEMORY_WRITE it reduces the apparent latency by 3 for writes, but shouldn't it do the same for PERFSCORE_MEMORY_READ_WRITE? Or is the assumption here that for RW instructions it's likely that another R/RW instruction follows for the same memory location?

Asking because I fixed some latency values (#49620) but then noticed the inconsistent logic.

Metadata

Metadata

Assignees

Labels

area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions