Add a return_at_end setting.

The flag guarantees that the generated function does not have any
internal return instructions. If the function returns at all, the return
must be the last instruction.

For now just implement a verifier check for this property. When we get
CFG simplifiers and block layout optimizations, they will need to heed
the flag.
This commit is contained in:
Jakob Stoklund Olesen
2017-09-11 11:04:38 -07:00
parent 7bf2747e1e
commit 25af6d380b
5 changed files with 61 additions and 0 deletions

View File

@@ -28,6 +28,16 @@ enable_verifier = BoolSetting(
is_64bit = BoolSetting("Enable 64-bit code generation")
return_at_end = BoolSetting(
"""
Generate functions with at most a single return instruction at the
end of the function.
This guarantees that functions do not have any internal return
instructions. Either they never return, or they have a single return
instruction at the end.
""")
is_compressed = BoolSetting("Enable compressed instructions")
enable_float = BoolSetting(