[X86] Move ReadAfterLd functionality into X86FoldableSchedWrite (PR36957)
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 5 Oct 2018 17:57:29 +0000 (17:57 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Fri, 5 Oct 2018 17:57:29 +0000 (17:57 +0000)
commitf09fc3bc126f6be0f02eb3ff984dd80926d9520c
tree42850cf83ead2c00f65276469a6c8723eead4f6d
parentc7d3e609fbf05d1a1236f99efd1e2fd344554f4b
[X86] Move ReadAfterLd functionality into X86FoldableSchedWrite (PR36957)

Currently we hardcode instructions with ReadAfterLd if the register operands don't need to be available until the folded load has completed. This doesn't take into account the different load latencies of different memory operands (PR36957).

This patch adds a ReadAfterFold def into X86FoldableSchedWrite to replace ReadAfterLd, allowing us to specify the load latency at a scheduler class level.

I've added ReadAfterVec*Ld classes that match the XMM/Scl, XMM and YMM/ZMM WriteVecLoad classes that we currently use, we can tweak these values in future patches once this infrastructure is in place.

Differential Revision: https://reviews.llvm.org/D52886

llvm-svn: 343868
22 files changed:
llvm/lib/Target/X86/X86Instr3DNow.td
llvm/lib/Target/X86/X86InstrAVX512.td
llvm/lib/Target/X86/X86InstrArithmetic.td
llvm/lib/Target/X86/X86InstrCMovSetCC.td
llvm/lib/Target/X86/X86InstrFMA.td
llvm/lib/Target/X86/X86InstrInfo.td
llvm/lib/Target/X86/X86InstrMMX.td
llvm/lib/Target/X86/X86InstrSSE.td
llvm/lib/Target/X86/X86InstrShiftRotate.td
llvm/lib/Target/X86/X86InstrXOP.td
llvm/lib/Target/X86/X86SchedBroadwell.td
llvm/lib/Target/X86/X86SchedHaswell.td
llvm/lib/Target/X86/X86SchedSandyBridge.td
llvm/lib/Target/X86/X86SchedSkylakeClient.td
llvm/lib/Target/X86/X86SchedSkylakeServer.td
llvm/lib/Target/X86/X86Schedule.td
llvm/lib/Target/X86/X86ScheduleAtom.td
llvm/lib/Target/X86/X86ScheduleBtVer2.td
llvm/lib/Target/X86/X86ScheduleSLM.td
llvm/lib/Target/X86/X86ScheduleZnver1.td
llvm/test/tools/llvm-mca/X86/read-after-ld-1.s
llvm/test/tools/llvm-mca/X86/read-after-ld-2.s