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:
parent
81047cdfc0
commit
d83bbd0f14
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user