This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] override isHighLatencyDef
ClosedPublic

Authored by rampitec on Jan 28 2020, 2:20 PM.

Details

Summary

SIMachineScheduler uses isHighLatencyInstruction with the same
sematincs, but TargetInstrInfo has virtual isHighLatencyDef
method, so override it instead.

Added FLAT to the list of high latency opcodes and a check for
mayLoad since stores are not technically high latency in terms
of data dependency.

This change did not produce any visible impact on our tests.

Diff Detail

Event Timeline

rampitec created this revision.Jan 28 2020, 2:20 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 28 2020, 2:20 PM
foad added a comment.Jan 29 2020, 2:32 AM

I have no objection to this patch, but I'm not sure isHighLatencyDef will ever be called by generic code. I think the latency information ususally comes from the sched model instead. Also note that TargetInstrInfo::defaultDefLatency never calls isHighLatencyDef on a load instruction!

foad accepted this revision.Jan 29 2020, 2:40 AM
This revision is now accepted and ready to land.Jan 29 2020, 2:40 AM

I have no objection to this patch, but I'm not sure isHighLatencyDef will ever be called by generic code. I think the latency information ususally comes from the sched model instead. Also note that TargetInstrInfo::defaultDefLatency never calls isHighLatencyDef on a load instruction!

Yes, I think this is mostly NFC. It is just confusing to have a very similar method and do not override a generic one.

This revision was automatically updated to reflect the committed changes.