what is a basic block called if it contains a branch instruction? [closed]
https://softwareengineering.stackexchange.com/questions/233784
-
03-10-2020 - |
Question
what is a basic block called if it contains a branch instruction? How about a block that does not contain a branch instruction?
Thanks,
Solution
The Wikipedia definition for Basic Block says that a basic block has one entry point, and one exit point.
It also says that the target of a jump instruction is a "leader," meaning that it marks the start of another basic block. So I guess they consider a jump (conditional or unconditional) an exit point.
It follows that jumps are places where you break off new basic blocks. I suppose you call a basic block containing a branch instruction "not a basic block."
OTHER TIPS
If a basic block contains any non-linear code-path (like a branch or jump) then it is not a basic block, by definition.