Skip to content

Commit dc3e4c6

Browse files
committed
Revert "[Sparc] Add support for the cycle counter available in GR740"
It breaks when using EXPENSIVE_CHECKS with the error message "Bad machine code: Using an undefined physical register". llvm-svn: 339570
1 parent 4e1293b commit dc3e4c6

File tree

6 files changed

+2
-32
lines changed

6 files changed

+2
-32
lines changed

llvm/lib/Target/Sparc/LeonFeatures.td

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,3 @@ def FixAllFDIVSQRT : SubtargetFeature<
5858
"true",
5959
"LEON erratum fix: Fix FDIVS/FDIVD/FSQRTS/FSQRTD instructions with NOPs and floating-point store"
6060
>;
61-
62-
def LeonCycleCounter
63-
: SubtargetFeature<"leoncyclecounter", "HasLeonCycleCounter", "true",
64-
"Use the Leon cycle counter register">;

llvm/lib/Target/Sparc/Sparc.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def : Processor<"leon4", LEON4Itineraries,
159159
// LEON 4 FT (GR740)
160160
// TO DO: Place-holder: Processor specific features will be added *very* soon here.
161161
def : Processor<"gr740", LEON4Itineraries,
162-
[FeatureLeon, UMACSMACSupport, LeonCASA, LeonCycleCounter]>;
162+
[FeatureLeon, UMACSMACSupport, LeonCASA]>;
163163

164164
//===----------------------------------------------------------------------===//
165165
// Declare the target which we are implementing

llvm/lib/Target/Sparc/SparcISelLowering.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,9 +1841,6 @@ SparcTargetLowering::SparcTargetLowering(const TargetMachine &TM,
18411841
setOperationAction(ISD::FMUL, MVT::f32, Promote);
18421842
}
18431843

1844-
if (Subtarget->hasLeonCycleCounter())
1845-
setOperationAction(ISD::READCYCLECOUNTER, MVT::i64, Custom);
1846-
18471844
setOperationAction(ISD::INTRINSIC_WO_CHAIN, MVT::Other, Custom);
18481845

18491846
setMinFunctionAlignment(2);
@@ -3590,16 +3587,7 @@ void SparcTargetLowering::ReplaceNodeResults(SDNode *N,
35903587
getLibcallName(libCall),
35913588
1));
35923589
return;
3593-
case ISD::READCYCLECOUNTER: {
3594-
assert(Subtarget->hasLeonCycleCounter());
3595-
SDValue Lo = DAG.getCopyFromReg(N->getOperand(0), dl, SP::ASR23, MVT::i32);
3596-
SDValue Hi = DAG.getCopyFromReg(Lo, dl, SP::G0, MVT::i32);
3597-
SDValue Ops[] = { Lo, Hi };
3598-
SDValue Pair = DAG.getNode(ISD::BUILD_PAIR, dl, MVT::i64, Ops);
3599-
Results.push_back(Pair);
3600-
Results.push_back(N->getOperand(0));
3601-
return;
3602-
}
3590+
36033591
case ISD::SINT_TO_FP:
36043592
case ISD::UINT_TO_FP:
36053593
// Custom lower only if it involves f128 or i64.

llvm/lib/Target/Sparc/SparcSubtarget.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ SparcSubtarget &SparcSubtarget::initializeSubtargetDependencies(StringRef CPU,
4747
InsertNOPLoad = false;
4848
FixAllFDIVSQRT = false;
4949
DetectRoundChange = false;
50-
HasLeonCycleCounter = false;
5150

5251
// Determine default and user specified characteristics
5352
std::string CPUName = CPU;

llvm/lib/Target/Sparc/SparcSubtarget.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class SparcSubtarget : public SparcGenSubtargetInfo {
5050
bool InsertNOPLoad;
5151
bool FixAllFDIVSQRT;
5252
bool DetectRoundChange;
53-
bool HasLeonCycleCounter;
5453

5554
SparcInstrInfo InstrInfo;
5655
SparcTargetLowering TLInfo;
@@ -96,7 +95,6 @@ class SparcSubtarget : public SparcGenSubtargetInfo {
9695
bool insertNOPLoad() const { return InsertNOPLoad; }
9796
bool fixAllFDIVSQRT() const { return FixAllFDIVSQRT; }
9897
bool detectRoundChange() const { return DetectRoundChange; }
99-
bool hasLeonCycleCounter() const { return HasLeonCycleCounter; }
10098

10199
/// ParseSubtargetFeatures - Parses features string setting specified
102100
/// subtarget options. Definition of function is auto generated by tblgen.

llvm/test/CodeGen/SPARC/readcycle.ll

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)