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:
@@ -211,6 +211,12 @@ def gen_xform(xform, fmt):
|
||||
# variables.
|
||||
unwrap_inst('inst', xform.src.rtl[0], fmt)
|
||||
|
||||
# We could support instruction predicates, but not yet. Should we just
|
||||
# return false if it fails? What about multiple patterns with different
|
||||
# predicates for the same opcode?
|
||||
instp = xform.src.rtl[0].expr.inst_predicate()
|
||||
assert instp is None, "Instruction predicates not supported in legalizer"
|
||||
|
||||
# Emit the destination pattern.
|
||||
for dst in xform.dst.rtl:
|
||||
emit_dst_inst(dst, fmt)
|
||||
|
||||
Reference in New Issue
Block a user