X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=utils%2FTableGen%2FCodeGenDAGPatterns.h;h=0d29eb51658d63d4c2c7cbefb1f08ba667cda898;hb=8e7254cd44465e134fa28c813930856a8e7db611;hp=44c154a353792e0a8a2966a962b81ac93cfa5398;hpb=b5af3344c196de5ed3f45b250dfb864be6e9ddc5;p=oota-llvm.git diff --git a/utils/TableGen/CodeGenDAGPatterns.h b/utils/TableGen/CodeGenDAGPatterns.h index 44c154a3537..0d29eb51658 100644 --- a/utils/TableGen/CodeGenDAGPatterns.h +++ b/utils/TableGen/CodeGenDAGPatterns.h @@ -15,7 +15,8 @@ #ifndef CODEGEN_DAGPATTERNS_H #define CODEGEN_DAGPATTERNS_H -#include "TableGenBackend.h" +#include + #include "CodeGenTarget.h" #include "CodeGenIntrinsics.h" @@ -48,6 +49,9 @@ namespace MVT { bool isExtFloatingPointInVTs(const std::vector &EVTs); } +/// Set type used to track multiply used variables in patterns +typedef std::set MultipleUseVarSet; + /// SDTypeConstraint - This is a discriminated union of constraints, /// corresponding to the SDTypeConstraint tablegen class in Target.td. struct SDTypeConstraint { @@ -231,7 +235,8 @@ public: // Higher level manipulation routines. /// the specified node. For this comparison, all of the state of the node /// is considered, except for the assigned name. Nodes with differing names /// that are otherwise identical are considered isomorphic. - bool isIsomorphicTo(const TreePatternNode *N) const; + bool isIsomorphicTo(const TreePatternNode *N, + const MultipleUseVarSet &DepVars) const; /// SubstituteFormalArguments - Replace the formal arguments in this tree /// with actual values specified by ArgMap. @@ -271,7 +276,7 @@ public: // Higher level manipulation routines. /// canPatternMatch - If it is impossible for this pattern to match on this /// target, fill in Reason and return false. Otherwise, return true. - bool canPatternMatch(std::string &Reason, CodeGenDAGPatterns &CDP); + bool canPatternMatch(std::string &Reason, const CodeGenDAGPatterns &CDP); }; @@ -461,6 +466,7 @@ public: CodeGenDAGPatterns(RecordKeeper &R); ~CodeGenDAGPatterns(); + CodeGenTarget &getTargetInfo() { return Target; } const CodeGenTarget &getTargetInfo() const { return Target; } Record *getSDNodeNamed(const std::string &Name) const; @@ -550,6 +556,7 @@ private: void ParseDefaultOperands(); void ParseInstructions(); void ParsePatterns(); + void InferInstructionFlags(); void GenerateVariants(); void FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,