From 502b23a7a965ddd46a8fe3d79ddbd26e274f7c6d Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sat, 30 May 2015 04:14:10 +0000 Subject: [sdag] Add the helper I most want to the DAG -- building a bitcast around a value using its existing SDLoc. Start using this in just one function to save omg lines of code. llvm-svn: 238638 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index efd4bd9a4d8..b9eb8f0d0ff 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1810,6 +1810,13 @@ SDValue SelectionDAG::getMDNode(const MDNode *MD) { return SDValue(N, 0); } +SDValue SelectionDAG::getBitcast(EVT VT, SDValue V) { + if (VT == V.getValueType()) + return V; + + return getNode(ISD::BITCAST, SDLoc(V), VT, V); +} + /// getAddrSpaceCast - Return an AddrSpaceCastSDNode. SDValue SelectionDAG::getAddrSpaceCast(SDLoc dl, EVT VT, SDValue Ptr, unsigned SrcAS, unsigned DestAS) { -- cgit v1.2.3