summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-05-30 04:14:10 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-05-30 04:14:10 +0000
commit502b23a7a965ddd46a8fe3d79ddbd26e274f7c6d (patch)
tree5be1accbcbc883942addca90a4660552cd450060 /llvm/lib/CodeGen
parent2599da3cfd519ed59a574d446cd7b25bf543be74 (diff)
downloadbcm5719-llvm-502b23a7a965ddd46a8fe3d79ddbd26e274f7c6d.tar.gz
bcm5719-llvm-502b23a7a965ddd46a8fe3d79ddbd26e274f7c6d.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp7
1 files changed, 7 insertions, 0 deletions
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) {
OpenPOWER on IntegriCloud