aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-01-28 22:52:50 +0000
committerChris Lattner <sabre@nondot.org>2005-01-28 22:52:50 +0000
commite76ad6de40b5e4c0399257b0438914c8c85ceaa1 (patch)
treec3597276463cabfe8f50819fbd54e44ac0603bab /lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parente560521f1af300a10717ca5c73d42df9ffb1b121 (diff)
implement legalization of truncates whose results and sources need to be
truncated, e.g. (truncate:i8 something:i16) on a 32 or 64-bit RISC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/LegalizeDAG.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 32cf597072..e435bd609d 100644
--- a/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1035,10 +1035,13 @@ SDOperand SelectionDAGLegalize::PromoteOp(SDOperand Op) {
if (Result.getValueType() > NVT) // Truncate to NVT instead of VT
Result = DAG.getNode(ISD::TRUNCATE, NVT, Result);
break;
+ case Promote:
+ // The truncation is not required, because we don't guarantee anything
+ // about high bits anyway.
+ Result = PromoteOp(Node->getOperand(0));
+ break;
case Expand:
assert(0 && "Cannot handle expand yet");
- case Promote:
- assert(0 && "Cannot handle promote-promote yet");
}
break;
case ISD::SIGN_EXTEND: