X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FSelectionDAG.h;h=89f9005b8b2111f7a7d8eb9a62ca01591222c21a;hp=b47022e554a93ecf5cbb8855eaef473f88f31d8f;hb=ec8c491a0649ca598aac3f29d200d114845b9d2d;hpb=f6548b86b6b7153eb31d05dc6eafae9245735128 diff --git a/include/llvm/CodeGen/SelectionDAG.h b/include/llvm/CodeGen/SelectionDAG.h index b47022e554a..89f9005b8b2 100644 --- a/include/llvm/CodeGen/SelectionDAG.h +++ b/include/llvm/CodeGen/SelectionDAG.h @@ -112,6 +112,7 @@ private: /// motion, and debug info for them is potentially useful even if the parameter /// is unused. Right now only byval parameters are handled separately. class SDDbgInfo { + BumpPtrAllocator Alloc; SmallVector DbgValues; SmallVector ByvalParmDbgValues; typedef DenseMap > DbgValMapType; @@ -138,8 +139,11 @@ public: DbgValMap.clear(); DbgValues.clear(); ByvalParmDbgValues.clear(); + Alloc.Reset(); } + BumpPtrAllocator &getAlloc() { return Alloc; } + bool empty() const { return DbgValues.empty() && ByvalParmDbgValues.empty(); } @@ -665,7 +669,7 @@ public: SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT); SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N); SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1, SDValue N2, - const SDNodeFlags *Flags = nullptr); + bool nuw = false, bool nsw = false, bool exact = false); SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1, SDValue N2, SDValue N3); SDValue getNode(unsigned Opcode, SDLoc DL, EVT VT, SDValue N1, SDValue N2, @@ -982,7 +986,8 @@ public: /// Get the specified node if it's already available, or else return NULL. SDNode *getNodeIfExists(unsigned Opcode, SDVTList VTs, ArrayRef Ops, - const SDNodeFlags *Flags = nullptr); + bool nuw = false, bool nsw = false, + bool exact = false); /// Creates a SDDbgValue node. SDDbgValue *getDbgValue(MDNode *Var, MDNode *Expr, SDNode *N, unsigned R, @@ -1127,6 +1132,10 @@ public: SDValue FoldConstantArithmetic(unsigned Opcode, SDLoc DL, EVT VT, SDNode *Cst1, SDNode *Cst2); + SDValue FoldConstantArithmetic(unsigned Opcode, SDLoc DL, EVT VT, + const ConstantSDNode *Cst1, + const ConstantSDNode *Cst2); + /// Constant fold a setcc to true or false. SDValue FoldSetCC(EVT VT, SDValue N1, SDValue N2, ISD::CondCode Cond, SDLoc dl); @@ -1240,8 +1249,20 @@ private: void allnodes_clear(); BinarySDNode *GetBinarySDNode(unsigned Opcode, SDLoc DL, SDVTList VTs, - SDValue N1, SDValue N2, - const SDNodeFlags *Flags = nullptr); + SDValue N1, SDValue N2, bool nuw, bool nsw, + bool exact); + + /// Look up the node specified by ID in CSEMap. If it exists, return it. If + /// not, return the insertion token that will make insertion faster. This + /// overload is for nodes other than Constant or ConstantFP, use the other one + /// for those. + SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, void *&InsertPos); + + /// Look up the node specified by ID in CSEMap. If it exists, return it. If + /// not, return the insertion token that will make insertion faster. Performs + /// additional processing for constant nodes. + SDNode *FindNodeOrInsertPos(const FoldingSetNodeID &ID, DebugLoc DL, + void *&InsertPos); /// List of non-single value types. FoldingSet VTListMap;