Jump threading

In computing, jump threading is a compiler optimization of one jump directly to a second jump. If the second condition is a subset or inverse of the first, it can be eliminated, or threaded through the first jump.[1] This is easily done in a single pass through the program, following acyclic chained jumps until the compiler arrives at a fixed point.

Example

The following pseudocode demonstrates when a jump may be threaded.

   10. a = SomeNumber();
   20. IF a > 10 GOTO 50
   ...
   50. IF a > 0 GOTO 100
   ...

The jump on line 50 will always be taken if the jump on line 20 is taken. Therefore the jump on line 20 may safely be modified to jump directly to line 100.

gollark: PotatOS uses that for disk signing.
gollark: There's ECC stuff available.
gollark: Previously you used to be able to identify the location of computers by ID if they were sending GPS pings, but that's anonymized now.
gollark: I also have a thing which integrates that with a reader thing for the Opus status broadcasts, so it can track a lot of information, and the location, of anyone using Opus on their neural interfaces.
gollark: You can use a bunch of modems in different positions and some code "borrowed" from GPS to trilaterate the sender of modem messages, which is neat. I have a thing for that.

References


This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.