diff options
Diffstat (limited to 'lib/Target/R600/AMDILISelDAGToDAG.cpp')
-rw-r--r-- | lib/Target/R600/AMDILISelDAGToDAG.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDILISelDAGToDAG.cpp b/lib/Target/R600/AMDILISelDAGToDAG.cpp index 2e726e9..2f70fa9 100644 --- a/lib/Target/R600/AMDILISelDAGToDAG.cpp +++ b/lib/Target/R600/AMDILISelDAGToDAG.cpp @@ -43,6 +43,7 @@ public: SDNode *Select(SDNode *N); virtual const char *getPassName() const; + virtual void PostprocessISelDAG(); private: inline SDValue getSmallIPtrImm(unsigned Imm); @@ -575,3 +576,21 @@ bool AMDGPUDAGToDAGISel::SelectADDRIndirect(SDValue Addr, SDValue &Base, return true; } + +void AMDGPUDAGToDAGISel::PostprocessISelDAG() { + + // Go over all selected nodes and try to fold them a bit more + const AMDGPUTargetLowering& Lowering = ((const AMDGPUTargetLowering&)TLI); + for (SelectionDAG::allnodes_iterator I = CurDAG->allnodes_begin(), + E = CurDAG->allnodes_end(); I != E; ++I) { + + MachineSDNode *Node = dyn_cast<MachineSDNode>(I); + if (!Node) + continue; + + SDNode *ResNode = Lowering.PostISelFolding(Node, *CurDAG); + if (ResNode != Node) + ReplaceUses(Node, ResNode); + } +} + |