This is an archive of the discontinued LLVM Phabricator instance.

[x86] put nops into the WriteNop class and customize for Jaguar
ClosedPublic

Authored by spatel on Mar 18 2018, 8:08 AM.

Details

Summary
  1. Given that we already have a classification bucket with 'nop' in the name, I think that's where 'nop' belongs. Right now, it's only otherwise used for prefix bytes.
  2. Make the latency of this class '0' because it has no dependencies.

I'm stopping there to make sure I'm on the right track. If so, then I can change other CPU sched models where either latency is not set to 0 for WriteNop (eg SNB) or it's explicitly overridden by instregex (eg HSW).

Diff Detail

Event Timeline

spatel created this revision.Mar 18 2018, 8:08 AM

x87 fnop as well?

test/CodeGen/X86/schedule-x86_64.ll
8398

According to the 16h SOG tables, these should be [1:0.5] on the ALU pipes

spatel updated this revision to Diff 138855.Mar 18 2018, 9:39 AM
spatel retitled this revision from [x86] put nops into the WriteNop class and make latency = 0 for Jaguar to [x86] put nops into the WriteNop class and customize for Jaguar.
spatel added a reviewer: andreadb.

Patch updated:

  1. Use latency = 1 and specify units for Jaguar. As noted in the comment, this tells the scheduler (and presumably llvm-mca) how to model the resource requirements better even though a nop has no dependencies.
  2. Move 'fnop' from the default WriteMicrocoded class to WriteNop. This may not be completely accurate for Jaguar, but it's still closer to the truth (and also for Silvermont based on Agner's tables).
courbet accepted this revision.Mar 19 2018, 2:15 AM
  1. Move 'fnop' from the default WriteMicrocoded class to WriteNop. This may not be completely accurate for Jaguar, but it's still closer to the truth (and also for Silvermont based on Agner's tables).

I agree that this is likely more accurate latencywise, and that WriteNop is a very reasonable default. Intel scheduling models override it anyway for each microarchitecture.

This revision is now accepted and ready to land.Mar 19 2018, 2:15 AM
This revision was automatically updated to reflect the committed changes.