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.
In
getInsExecutionCharacteristicsthere are three different ways used to calculate memory access latencies, used seemingly at random (except for special instructions likemov)result.insLatency += ins_latency;- this seems the most logical option, e.g.INS_addsdresult.insLatency = max(ins_latency, result.insLatency);- looks incorrect to me, e.g.INS_addresult.insLatencynot set ifmemAccessKind != PERFSCORE_MEMORY_NONE- incorrect, e.g.INS_aesdecAnd a related question for
insEvaluateExecutionCost- ifmemAccessKind == PERFSCORE_MEMORY_WRITEit reduces the apparent latency by 3 for writes, but shouldn't it do the same forPERFSCORE_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.