1. A computer-implemented method for managing threads, the method comprising: causing a first set of threads to execute a first instruction that is specified by a first program counter, wherein the first set of threads and the first program counter are included in a first node of a tree divergence table; if causing the first set of threads to execute the first instruction causes a first execution path to diverge, then: generating a second node of the tree divergence table that includes a second set of threads that is a subset of the first set of threads and a second program counter that specifies a second instruction, generating a third node of the tree divergence table that includes a third set of threads that is a subset of the first set of threads and a third program counter that specifies a third instruction that is on a second execution path, updating the first program counter to specify a synchronization instruction, and causing the second set of threads to execute the second instruction and the third set of threads to execute the third instruction; or if causing the first set of threads to execute the first instruction does not cause the first execution path to diverge, then: updating the first program counter to specify a fourth instruction, and causing the first set of threads to execute the fourth instruction.