Implementation
Unrolling is usually done in early stages of the compilation allowing for optimization (scheduling) at later stages.
How many copies? If n is known, the compiler usually makes a pair of loops, one of single copy and the second one for k copies. First loop executes (n mod k) times and the second one (n/k) times.