Move instruction flag inference out of InstrInfoEmitter and into

CodeGenDAGPatterns, where it can be used in other tablegen backends.
This allows the inference to be done for DAGISelEmitter so that it
gets accurate mayLoad/mayStore/isSimpleLoad flags. 

This brings MemOperand functionality back to where it was before
48329. However, it doesn't solve the problem of anonymous patterns
which expand to code that does loads or stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49123 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman
2008-04-03 00:02:49 +00:00
parent 271515a46d
commit ee4fa1977d
8 changed files with 163 additions and 152 deletions

View File

@ -17,7 +17,6 @@
#include <set>
#include "TableGenBackend.h"
#include "CodeGenTarget.h"
#include "CodeGenIntrinsics.h"
@ -277,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);
};
@ -467,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;
@ -556,6 +556,7 @@ private:
void ParseDefaultOperands();
void ParseInstructions();
void ParsePatterns();
void InferInstructionFlags();
void GenerateVariants();
void FindPatternInputsAndOutputs(TreePattern *I, TreePatternNode *Pat,