[System Model] [TTI] Update cache and prefetch TTI interfaces
Audit Required9fdfb045ae8b

Authored by greened on Jul 10 2019, 11:07 AM.


[System Model] [TTI] Update cache and prefetch TTI interfaces

Rework the TTI cache and software prefetching APIs to prepare for the
introduction of a general system model. Changes include:

  • Marking existing interfaces const and/or override as appropriate
  • Adding comments
  • Adding BasicTTIImpl interfaces that delegate to a subtarget implementation
  • Adding a default "no information" subtarget implementation

Only a handful of targets use these interfaces currently: AArch64,
Hexagon, PPC and SystemZ. AArch64 already has a custom subtarget
implementation, so its custom TTI implementation is migrated to use
the new facilities in BasicTTIImpl to invoke its custom subtarget
implementation. The custom TTI implementations continue to exist for
the other targets with this change. They are not moved over to
subtarget-based implementations.

The end goal is to have the default subtarget implementation defer to
the system model defined by the target. With this change, the default
subtarget implementation essentially returns "no information" for
these interfaces. None of the existing users of TTI will hit that
implementation because they define their own custom TTI
implementations and won't use the BasicTTIImpl implementations.

Once system models are in place for the targets that use these
interfaces, their custom TTI implementations can be removed.

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

llvm-svn: 365676