aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Michel <scottm@aero.org>2008-04-30 00:26:38 +0000
committerScott Michel <scottm@aero.org>2008-04-30 00:26:38 +0000
commit82747a54849d22c3a0b7c3b56399da9b9e020ee0 (patch)
tree11057c3244c5dfe049f3c38d7293d5a02119b45b
parent7b251e0474466d067192339599e38b9be000b6a3 (diff)
Fix custom target lowering for zero/any/sign_extend: make sure that
DAG.UpdateNodeOperands() is called before (not after) the call to TLI.LowerOperation(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50461 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index f964fb6be5..f8e44ec695 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/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()) {