[Sparc] Add support for the cycle counter available in GR740
authorDaniel Cederman <cederman@gaisler.com>
Mon, 27 Aug 2018 11:11:47 +0000 (11:11 +0000)
committerDaniel Cederman <cederman@gaisler.com>
Mon, 27 Aug 2018 11:11:47 +0000 (11:11 +0000)
commit2739596063a914f4a1918bde30e72d50fea856c2
treefaff6d3b99db67ab4fa410eebe495b9aa68276c3
parent9441be6912a8d34245ad928e0d55e4cb3632c4fa
[Sparc] Add support for the cycle counter available in GR740

Summary: The GR740 provides an up cycle counter in the registers ASR22
and ASR23. As these registers can not be read together atomically we only
use the value of ASR23 for llvm.readcyclecounter(). The ASR23 register
holds the 32 LSBs of the up-counter.

Reviewers: jyknight, venkatra

Reviewed By: jyknight

Subscribers: jfb, fedor.sergeev, jrtc27, llvm-commits

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

llvm-svn: 340733
llvm/lib/Target/Sparc/LeonFeatures.td
llvm/lib/Target/Sparc/Sparc.td
llvm/lib/Target/Sparc/SparcISelLowering.cpp
llvm/lib/Target/Sparc/SparcRegisterInfo.cpp
llvm/lib/Target/Sparc/SparcSubtarget.cpp
llvm/lib/Target/Sparc/SparcSubtarget.h
llvm/test/CodeGen/SPARC/readcycle.ll [new file with mode: 0644]