Leopold Toetsch wrote:
4.2) Basic blocks, life span of symbols inside these blocks and loop detection.
Baisc block generation depends on two items: * labels - a possible branch target * branching opcodes
Detection of branching opcodes depends currently in a not too obvious way[1] on directives in ops/*.ops like:
goto NEXT() # no branch, just execute next instruction
goto ADDRESS(next) # a branch
Now all find_global and find_lex opcodes *did* use goto ADDRESS(next). This might be some relict of experiments with exceptions. These opcodes might branch elsewhere, if an exception had occured. But its not a branch.
I've change these opcodes to use goto NEXT() and excluded PARROT_JUMP_ENEXT from considering this opcode as a branch.
This fix should vastly improve PIR programs that make heavy use of find_lex or find_global opcodes (hello Dan).
leo
[1] see lib/Parrot/OpsFile.pm line 525ff