From: Simon Pilgrim Date: Sat, 13 Jun 2015 15:23:58 +0000 (+0000) Subject: [SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation. X-Git-Tag: llvmorg-3.7.0-rc1~2418 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c35e7a264608de328d65755d499fb9a94bbf9fe;p=platform%2Fupstream%2Fllvm.git [SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation. llvm-svn: 239679 --- diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 27fa3d2..20cec6e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -3082,6 +3082,14 @@ SDValue SelectionDAG::getNode(unsigned Opcode, SDLoc DL, if (OpOpcode == ISD::UNDEF) return getUNDEF(VT); break; + case ISD::BSWAP: + assert(VT.isInteger() && VT == Operand.getValueType() && + "Invalid BSWAP!"); + assert((VT.getScalarSizeInBits() % 16 == 0) && + "BSWAP types must be a multiple of 16 bits!"); + if (OpOpcode == ISD::UNDEF) + return getUNDEF(VT); + break; case ISD::BITCAST: // Basic sanity checking. assert(VT.getSizeInBits() == Operand.getValueType().getSizeInBits()