views:

81

answers:

2

Are reordering and interleaving interchangeable terms when it comes to code compilation, optimization and execution?

+1  A: 

I'd say they describe a similar technique but mean something else at the detail level.

Reordering means to take random instructions and move them around for some reason. It's pretty generic.

Interleaving means to have two long pieces of code which access different hardware resources and which can therefore run in parallel. Weaving the instructions in a clever pattern can result in better execution times.

Aaron Digulla
A: 

in case you are referring to out-of-order execution, this is something done at runtime by the processor depending on the availability of execution units and the instructions to be issued, while what Aaron described above would be at compile time (or even development time, if the code is complex (pointer aliasing comes to mind) or the compiler is not too good).

Gautham Ganapathy