diff options
author | Evan Cheng <evan.cheng@apple.com> | 2006-11-29 19:13:47 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2006-11-29 19:13:47 +0000 |
commit | 6a16c5ab2d7786583d3c9a79646dc85fbda6cd41 (patch) | |
tree | 26a4aaafb5dc16254c1659534151767e85c384bc | |
parent | 36729ddd23fe51e10eabfc7e8ac4d4635a0b7935 (diff) |
Avoid inifinite looping if READCYCLECOUNTER isn't custom lowered.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32022 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 1c0be0ba52..bf467b733d 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -1850,16 +1850,21 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) { switch (TLI.getOperationAction(ISD::READCYCLECOUNTER, Node->getValueType(0))) { default: assert(0 && "This action is not supported yet!"); - case TargetLowering::Legal: break; + case TargetLowering::Legal: + Tmp1 = Result.getValue(0); + Tmp2 = Result.getValue(1); + break; case TargetLowering::Custom: Result = TLI.LowerOperation(Result, DAG); + Tmp1 = LegalizeOp(Result.getValue(0)); + Tmp2 = LegalizeOp(Result.getValue(1)); break; } // Since rdcc produce two values, make sure to remember that we legalized // both of them. - AddLegalizedOperand(SDOperand(Node, 0), LegalizeOp(Result.getValue(0))); - AddLegalizedOperand(SDOperand(Node, 1), LegalizeOp(Result.getValue(1))); + AddLegalizedOperand(SDOperand(Node, 0), Tmp1); + AddLegalizedOperand(SDOperand(Node, 1), Tmp2); return Result; case ISD::SELECT: |