From a9e77d14c742603528ba6bc403da5a5566fb6c26 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 4 Apr 2006 01:02:22 +0000 Subject: [PATCH] Constant fold bitconvert(undef) llvm-svn: 27391 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6eb6570467fa..a2b575ff31d8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1167,6 +1167,8 @@ SDOperand SelectionDAG::getNode(unsigned Opcode, MVT::ValueType VT, if (VT == Operand.getValueType()) return Operand; // noop conversion. if (OpOpcode == ISD::BIT_CONVERT) // bitconv(bitconv(x)) -> bitconv(x) return getNode(ISD::BIT_CONVERT, VT, Operand.getOperand(0)); + if (OpOpcode == ISD::UNDEF) + return getNode(ISD::UNDEF, VT); break; case ISD::SCALAR_TO_VECTOR: assert(MVT::isVector(VT) && !MVT::isVector(Operand.getValueType()) &&