projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add TableGen support for callee saved registers.
[oota-llvm.git]
/
utils
/
TableGen
/
CodeGenDAGPatterns.cpp
diff --git
a/utils/TableGen/CodeGenDAGPatterns.cpp
b/utils/TableGen/CodeGenDAGPatterns.cpp
index 4954f339869ac8c333f1417ff54e8e5871f7ad1c..5087935d91d691a468e6b1048bbc04b4e7c1cdd1 100644
(file)
--- a/
utils/TableGen/CodeGenDAGPatterns.cpp
+++ b/
utils/TableGen/CodeGenDAGPatterns.cpp
@@
-18,6
+18,7
@@
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Debug.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/Debug.h"
+#include "llvm/Support/ErrorHandling.h"
#include <set>
#include <algorithm>
using namespace llvm;
#include <set>
#include <algorithm>
using namespace llvm;
@@
-629,11
+630,11
@@
TreePredicateFn::TreePredicateFn(TreePattern *N) : PatFragRec(N) {
}
std::string TreePredicateFn::getPredCode() const {
}
std::string TreePredicateFn::getPredCode() const {
- return PatFragRec->getRecord()->getValueAs
Code
("PredicateCode");
+ return PatFragRec->getRecord()->getValueAs
String
("PredicateCode");
}
std::string TreePredicateFn::getImmCode() const {
}
std::string TreePredicateFn::getImmCode() const {
- return PatFragRec->getRecord()->getValueAs
Code
("ImmediateCode");
+ return PatFragRec->getRecord()->getValueAs
String
("ImmediateCode");
}
}
@@
-839,7
+840,6
@@
bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NodeInfo, ResNo);
switch (ConstraintType) {
TreePatternNode *NodeToApply = getOperandNum(OperandNo, N, NodeInfo, ResNo);
switch (ConstraintType) {
- default: assert(0 && "Unknown constraint type!");
case SDTCisVT:
// Operand must be a particular type.
return NodeToApply->UpdateNodeType(ResNo, x.SDTCisVT_Info.VT, TP);
case SDTCisVT:
// Operand must be a particular type.
return NodeToApply->UpdateNodeType(ResNo, x.SDTCisVT_Info.VT, TP);
@@
-913,7
+913,7
@@
bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
EnforceVectorSubVectorTypeIs(NodeToApply->getExtType(ResNo), TP);
}
}
EnforceVectorSubVectorTypeIs(NodeToApply->getExtType(ResNo), TP);
}
}
-
return false
;
+
llvm_unreachable("Invalid ConstraintType!")
;
}
//===----------------------------------------------------------------------===//
}
//===----------------------------------------------------------------------===//
@@
-2071,7
+2071,7
@@
void CodeGenDAGPatterns::ParseNodeTransforms() {
while (!Xforms.empty()) {
Record *XFormNode = Xforms.back();
Record *SDNode = XFormNode->getValueAsDef("Opcode");
while (!Xforms.empty()) {
Record *XFormNode = Xforms.back();
Record *SDNode = XFormNode->getValueAsDef("Opcode");
- std::string Code = XFormNode->getValueAs
Code
("XFormFunction");
+ std::string Code = XFormNode->getValueAs
String
("XFormFunction");
SDNodeXForms.insert(std::make_pair(XFormNode, NodeXForm(SDNode, Code)));
Xforms.pop_back();
SDNodeXForms.insert(std::make_pair(XFormNode, NodeXForm(SDNode, Code)));
Xforms.pop_back();
@@
-2829,6
+2829,12
@@
void CodeGenDAGPatterns::InferInstructionFlags() {
InstInfo.isBitcast = IsBitcast;
InstInfo.hasSideEffects = HasSideEffects;
InstInfo.Operands.isVariadic = IsVariadic;
InstInfo.isBitcast = IsBitcast;
InstInfo.hasSideEffects = HasSideEffects;
InstInfo.Operands.isVariadic = IsVariadic;
+
+ // Sanity checks.
+ if (InstInfo.isReMaterializable && InstInfo.hasSideEffects)
+ throw TGError(InstInfo.TheDef->getLoc(), "The instruction " +
+ InstInfo.TheDef->getName() +
+ " is rematerializable AND has unmodeled side effects?");
}
}
}
}