diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-01-28 22:52:50 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-01-28 22:52:50 +0000 |
| commit | bf8c1ad31374a2e4c05cab178f3c6c5c134d9910 (patch) | |
| tree | be354f9929211f8038a9b18d19e9a5a51235ed2f /llvm/lib/CodeGen | |
| parent | a4cfafe31a0d75a491d01096da85f0f3f012ef53 (diff) | |
| download | bcm5719-llvm-bf8c1ad31374a2e4c05cab178f3c6c5c134d9910.tar.gz bcm5719-llvm-bf8c1ad31374a2e4c05cab178f3c6c5c134d9910.zip | |
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.
llvm-svn: 19879
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 32cf5970726..e435bd609de 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/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: |

