summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-09-28 20:58:06 +0000
committerChris Lattner <sabre@nondot.org>2005-09-28 20:58:06 +0000
commit492e70f4ec97f5069997674a9a84050adbd98c8c (patch)
tree92cbd7ba3dee430dd5d994a29eb9b5ba6958a2e1
parent8bb25cd68a98db0f7f9f222c20cbfbce2e32e1cd (diff)
downloadbcm5719-llvm-492e70f4ec97f5069997674a9a84050adbd98c8c.tar.gz
bcm5719-llvm-492e70f4ec97f5069997674a9a84050adbd98c8c.zip
add support for an associative marker
llvm-svn: 23502
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp6
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.h6
2 files changed, 7 insertions, 5 deletions
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index bac99ebbc2a..b7aa55843ea 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -145,6 +145,8 @@ SDNodeInfo::SDNodeInfo(Record *R) : Def(R) {
assert(DI && "Properties list must be list of defs!");
if (DI->getDef()->getName() == "SDNPCommutative") {
Properties |= 1 << SDNPCommutative;
+ } else if (DI->getDef()->getName() == "SDNPAssociative") {
+ Properties |= 1 << SDNPAssociative;
} else {
std::cerr << "Unknown SD Node property '" << DI->getDef()->getName()
<< "' on node '" << R->getName() << "'!\n";
@@ -377,7 +379,7 @@ bool TreePatternNode::ApplyTypeConstraints(TreePattern &TP) {
/// used as a santity check for .td files (to prevent people from writing stuff
/// that can never possibly work), and to prevent the pattern permuter from
/// generating stuff that is useless.
-bool TreePatternNode::canPatternMatch(std::string &Reason, DAGISelEmitter &ISE) {
+bool TreePatternNode::canPatternMatch(std::string &Reason, DAGISelEmitter &ISE){
if (isLeaf()) return true;
for (unsigned i = 0, e = getNumChildren(); i != e; ++i)
@@ -1052,9 +1054,9 @@ void DAGISelEmitter::ParsePatterns() {
// GenerateVariants - Generate variants. For example, commutative patterns can
// match multiple ways. Add them to PatternsToMatch as well.
void DAGISelEmitter::GenerateVariants() {
-
}
+
/// getPatternSize - Return the 'size' of this pattern. We want to match large
/// patterns before small ones. This is used to determine the size of a
/// pattern.
diff --git a/llvm/utils/TableGen/DAGISelEmitter.h b/llvm/utils/TableGen/DAGISelEmitter.h
index d169acfecc1..f452901dca6 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.h
+++ b/llvm/utils/TableGen/DAGISelEmitter.h
@@ -87,7 +87,7 @@ namespace llvm {
}
// SelectionDAG node properties.
- enum SDNP { SDNPCommutative };
+ enum SDNP { SDNPCommutative, SDNPAssociative };
/// hasProperty - Return true if this node has the specified property.
///
@@ -205,8 +205,8 @@ namespace llvm {
return false;
}
- /// canPatternMatch - Return false if it is impossible for this pattern to
- /// match on this target.
+ /// 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, DAGISelEmitter &ISE);
};
OpenPOWER on IntegriCloud