summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2015-06-13 15:23:58 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2015-06-13 15:23:58 +0000
commit2c35e7a264608de328d65755d499fb9a94bbf9fe (patch)
tree4e87a5d00e081f028efcb119ca071129b99e570b /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent85924e5bf37724e8f14efff2e7bf59eebf7335fc (diff)
downloadbcm5719-llvm-2c35e7a264608de328d65755d499fb9a94bbf9fe.tar.gz
bcm5719-llvm-2c35e7a264608de328d65755d499fb9a94bbf9fe.zip
[SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation.
llvm-svn: 239679
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 27fa3d2b1e3..20cec6ebad1 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()
OpenPOWER on IntegriCloud