Add custom legalization for conditional traps.

The expansion of these instructions requires the CFG to be modified,
something the Python XForms can't yet do.
This commit is contained in:
Jakob Stoklund Olesen
2017-08-25 12:40:43 -07:00
parent 6d9198d55f
commit 217434b474
3 changed files with 82 additions and 1 deletions

View File

@@ -48,6 +48,11 @@ expand = XFormGroup('expand', """
expand.custom_legalize(insts.global_addr, 'expand_global_addr')
expand.custom_legalize(insts.heap_addr, 'expand_heap_addr')
# Custom expansions that need to change the CFG.
# TODO: Add sufficient XForm syntax that we don't need to hand-code these.
expand.custom_legalize(insts.trapz, 'expand_cond_trap')
expand.custom_legalize(insts.trapnz, 'expand_cond_trap')
x = Var('x')
y = Var('y')
a = Var('a')