Add Apply.inst_predicate().

Compute an instruction predicate from any constant values given as
arguments for the immediate operands in an instruction pattern.

Allows for patterns like icmp.i32(intcc.ugt, x, y) or iadd_imm.i32(x, 1)

Trap these predicates in the legalizer code generator since we can't
actually handle them yet.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-31 10:12:23 -07:00
parent 89ff979d75
commit 3c3d068379
3 changed files with 36 additions and 1 deletions

View File

@@ -216,7 +216,8 @@ class FieldPredicate(object):
This predicate can be evaluated in the context of an instruction
format.
"""
return self.field.format
iform = self.field.format # type: InstructionFormat
return iform
def predicate_leafs(self, leafs):
# type: (Set[PredLeaf]) -> None