Add a fallthrough instruction.

Change jumps to fallthroughs in the branch relaxation pass before
computing the EBB offsets.
This commit is contained in:
Jakob Stoklund Olesen
2017-04-06 14:22:32 -07:00
parent c6e027207c
commit e5e5b30315
4 changed files with 51 additions and 2 deletions

View File

@@ -49,6 +49,19 @@ jump = Instruction(
""",
ins=(EBB, args), is_branch=True, is_terminator=True)
fallthrough = Instruction(
'fallthrough', r"""
Fall through to the next EBB.
This is the same as :inst:`jump`, except the destination EBB must be
the next one in the layout.
Jumps are turned into fall-through instructions by the branch
relaxation pass. There is no reason to use this instruction outside
that pass.
""",
ins=(EBB, args), is_branch=True, is_terminator=True)
brz = Instruction(
'brz', r"""
Branch when zero.