mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
Add basic support for recognizing a new SDTCisOpSmallerThanOp type constraint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23725 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
0ee7cff4fb
commit
03ebd802c7
@ -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