#include "Basic/SDNodeProperties.h"
#include "Common/CodeGenDAGPatterns.h"
#include "Common/CodeGenInstruction.h"
#include "Common/CodeGenRegisters.h"
#include "Common/CodeGenTarget.h"
#include "Common/DAGISelMatcher.h"
#include "Common/InfoByHwMode.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <utility>
usingnamespacellvm;
static MVT::SimpleValueType getRegisterValueType(Record *R,
const CodeGenTarget &T) { … }
namespace {
class MatcherGen { … };
}
MatcherGen::MatcherGen(const PatternToMatch &pattern,
const CodeGenDAGPatterns &cgp)
: … { … }
void MatcherGen::InferPossibleTypes() { … }
void MatcherGen::AddMatcher(Matcher *NewNode) { … }
void MatcherGen::EmitLeafMatchCode(const TreePatternNode &N) { … }
void MatcherGen::EmitOperatorMatchCode(const TreePatternNode &N,
TreePatternNode &NodeNoTypes) { … }
bool MatcherGen::recordUniqueNode(ArrayRef<std::string> Names) { … }
void MatcherGen::EmitMatchCode(const TreePatternNode &N,
TreePatternNode &NodeNoTypes) { … }
bool MatcherGen::EmitMatcherCode(unsigned Variant) { … }
void MatcherGen::EmitResultOfNamedOperand(
const TreePatternNode &N, SmallVectorImpl<unsigned> &ResultOps) { … }
void MatcherGen::EmitResultLeafAsOperand(const TreePatternNode &N,
SmallVectorImpl<unsigned> &ResultOps) { … }
static bool mayInstNodeLoadOrStore(const TreePatternNode &N,
const CodeGenDAGPatterns &CGP) { … }
static unsigned numNodesThatMayLoadOrStore(const TreePatternNode &N,
const CodeGenDAGPatterns &CGP) { … }
void MatcherGen::EmitResultInstructionAsOperand(
const TreePatternNode &N, SmallVectorImpl<unsigned> &OutputOps) { … }
void MatcherGen::EmitResultSDNodeXFormAsOperand(
const TreePatternNode &N, SmallVectorImpl<unsigned> &ResultOps) { … }
void MatcherGen::EmitResultOperand(const TreePatternNode &N,
SmallVectorImpl<unsigned> &ResultOps) { … }
void MatcherGen::EmitResultCode() { … }
Matcher *llvm::ConvertPatternToMatcher(const PatternToMatch &Pattern,
unsigned Variant,
const CodeGenDAGPatterns &CGP) { … }