Generalized selective scheduling (GSS) is presented to uniformly process loops and acyclic code. GSS does not differentiate acyclic code from cyclic code, but generates the result of global compaction and software pipelining for them respectively. The program is parallelized not by hierarchical simplification, but by only one-pass sequential scanning. As the first global scheduling based on general graphs instead of traces or directed acyclic graphs, GSS breaks the boundary between acyclic and cyclic code scheduling. It views nested loops from a fresh angle, realizing the direct scheduling of nests by properly calculating availability sets and live variable sets. It is applicable to programs with arbitrary control flow.