1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Add basic support for recognizing a new SDTCisOpSmallerThanOp type constraint

llvm-svn: 23725
This commit is contained in:
Chris Lattner 2005-10-14 04:53:53 +00:00
parent 81047cdfc0
commit d83bbd0f14
2 changed files with 13 additions and 1 deletions

View File

@ -40,6 +40,10 @@ SDTypeConstraint::SDTypeConstraint(Record *R) {
ConstraintType = SDTCisVTSmallerThanOp;
x.SDTCisVTSmallerThanOp_Info.OtherOperandNum =
R->getValueAsInt("OtherOperandNum");
} else if (R->isSubClassOf("SDTCisOpSmallerThanOp")) {
ConstraintType = SDTCisOpSmallerThanOp;
x.SDTCisOpSmallerThanOp_Info.BigOperandNum =
R->getValueAsInt("BigOperandNum");
} else {
std::cerr << "Unrecognized SDTypeConstraint '" << R->getName() << "'!\n";
exit(1);
@ -157,6 +161,10 @@ bool SDTypeConstraint::ApplyTypeConstraint(TreePatternNode *N,
OtherNode->UpdateNodeType(MVT::Other, TP); // Throw an error.
return false;
}
case SDTCisOpSmallerThanOp: {
// TODO
return false;
}
}
return false;
}

View File

@ -34,7 +34,8 @@ namespace llvm {
unsigned OperandNo; // The operand # this constraint applies to.
enum {
SDTCisVT, SDTCisInt, SDTCisFP, SDTCisSameAs, SDTCisVTSmallerThanOp
SDTCisVT, SDTCisInt, SDTCisFP, SDTCisSameAs, SDTCisVTSmallerThanOp,
SDTCisOpSmallerThanOp
} ConstraintType;
union { // The discriminated union.
@ -47,6 +48,9 @@ namespace llvm {
struct {
unsigned OtherOperandNum;
} SDTCisVTSmallerThanOp_Info;
struct {
unsigned BigOperandNum;
} SDTCisOpSmallerThanOp_Info;
} x;
/// ApplyTypeConstraint - Given a node in a pattern, apply this type