diff options
author | Scott Michel <scottm@aero.org> | 2008-12-02 19:55:08 +0000 |
---|---|---|
committer | Scott Michel <scottm@aero.org> | 2008-12-02 19:55:08 +0000 |
commit | 546d7b5c4a3cebf0d5017d42302b4a8d1c8ef584 (patch) | |
tree | 2a28152e3b33a2d03580bb2cf2c95c0fbb70a6f1 /lib | |
parent | b30e8f6334e9dd04098e834303ae1bd38abe20b0 (diff) |
Non-functional change: make custom lowering for truncate stylistically
consistent with the way it's generally done in other places.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60439 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index cd90f67251..d61d6ca6fd 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -3903,11 +3903,18 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) { switch (getTypeAction(Node->getOperand(0).getValueType())) { case Legal: Tmp1 = LegalizeOp(Node->getOperand(0)); - Result = DAG.UpdateNodeOperands(Result, Tmp1); - if (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0)) == - TargetLowering::Custom) { - Tmp1 = TLI.LowerOperation(Result, DAG); - if (Tmp1.getNode()) Result = Tmp1; + switch (TLI.getOperationAction(Node->getOpcode(), Node->getValueType(0))) { + default: assert(0 && "Unknown TRUNCATE legalization operation action!"); + case TargetLowering::Custom: + isCustom = true; + // FALLTHROUGH + case TargetLowering::Legal: + Result = DAG.UpdateNodeOperands(Result, Tmp1); + if (isCustom) { + Tmp1 = TLI.LowerOperation(Result, DAG); + if (Tmp1.getNode()) Result = Tmp1; + } + break; } break; case Expand: |