diff options
| author | Scott Michel <scottm@aero.org> | 2008-04-30 00:26:38 +0000 | 
|---|---|---|
| committer | Scott Michel <scottm@aero.org> | 2008-04-30 00:26:38 +0000 | 
| commit | be940424b36811707dcc73948219bbf4924163e7 (patch) | |
| tree | 8a83f10ccca4437c0f180d7b2185cd84a62c9ded /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | |
| parent | 9700bd42f0b9b2ee8f610f6ee2c18b4fab9a5331 (diff) | |
| download | bcm5719-llvm-be940424b36811707dcc73948219bbf4924163e7.tar.gz bcm5719-llvm-be940424b36811707dcc73948219bbf4924163e7.zip  | |
Fix custom target lowering for zero/any/sign_extend: make sure that
DAG.UpdateNodeOperands() is called before (not after) the call to
TLI.LowerOperation().
llvm-svn: 50461
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 8 | 
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index f964fb6be51..f8e44ec6956 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3874,14 +3874,12 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {      case Expand: assert(0 && "Shouldn't need to expand other operators here!");      case Legal:        Tmp1 = LegalizeOp(Node->getOperand(0)); +      Result = DAG.UpdateNodeOperands(Result, Tmp1);        if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) ==            TargetLowering::Custom) { -        Tmp2 = TLI.LowerOperation(Result, DAG); -        if (Tmp2.Val) { -          Tmp1 = Tmp2; -        } +        Tmp1 = TLI.LowerOperation(Result, DAG); +        if (Tmp1.Val) Result = Tmp1;        } -      Result = DAG.UpdateNodeOperands(Result, Tmp1);        break;      case Promote:        switch (Node->getOpcode()) {  | 

