Saturday, 25 February 2017

llvm SDValue

00091 /// Unlike LLVM values, Selection DAG nodes may return multiple
00092 /// values as the result of a computation.  Many nodes return multiple values,
00093 /// from loads (which define a token and a return value) to ADDC (which returns
00094 /// a result and a carry value), to calls (which may return an arbitrary number
00095 /// of values).
00096 ///
00097 /// As such, each use of a SelectionDAG computation must indicate the node that
00098 /// computes it as well as which return value to use from that node.  This pair
00099 /// of information is represented with the SDValue value type.
00100 ///
00101 class SDValue {
00102   friend struct DenseMapInfo<SDValue>;
00103 
00104   SDNode *Node;       // The node defining the value we are using.
00105   unsigned ResNo;     // Which return value of the node we are using.
00106 public:
00107   SDValue() : Node(nullptr), ResNo(0) {}
00108   SDValue(SDNode *node, unsigned resno);
00109 
00110   /// get the index which selects a specific result in the SDNode
00111   unsigned getResNo() const { return ResNo; }
 
 
Note, by default the result value is in the the first one,  cause we have  the default
set "ResNo(0)", knowing this is  very important for handling hardware instruction that
has multiple outputs which cannot be handled in .td file (like ADDC, SUBFC ADDIC etc) 

No comments:

Post a Comment