aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-11-29 08:26:18 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-11-29 08:26:18 +0000
commitf0b3ba6752a49a8868d423ddc2704a52b7101571 (patch)
tree2f8bf05a92c699628ebc77bf904704bda8aa62c0
parentb27c480d8413c6a749183ea780d816e4f9747fba (diff)
downloadexternal_llvm-f0b3ba6752a49a8868d423ddc2704a52b7101571.zip
external_llvm-f0b3ba6752a49a8868d423ddc2704a52b7101571.tar.gz
external_llvm-f0b3ba6752a49a8868d423ddc2704a52b7101571.tar.bz2
Allow target to custom lower READCYCLECOUNTER (when it doesn't have to be expanded).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32016 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 5b15dfb..1c0be0b 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1847,11 +1847,19 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
case ISD::READCYCLECOUNTER:
Tmp1 = LegalizeOp(Node->getOperand(0)); // Legalize the chain
Result = DAG.UpdateNodeOperands(Result, Tmp1);
+ switch (TLI.getOperationAction(ISD::READCYCLECOUNTER,
+ Node->getValueType(0))) {
+ default: assert(0 && "This action is not supported yet!");
+ case TargetLowering::Legal: break;
+ case TargetLowering::Custom:
+ Result = TLI.LowerOperation(Result, DAG);
+ break;
+ }
// Since rdcc produce two values, make sure to remember that we legalized
// both of them.
- AddLegalizedOperand(SDOperand(Node, 0), Result.getValue(0));
- AddLegalizedOperand(SDOperand(Node, 1), Result.getValue(1));
+ AddLegalizedOperand(SDOperand(Node, 0), LegalizeOp(Result.getValue(0)));
+ AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Result.getValue(1)));
return Result;
case ISD::SELECT: