开发者

Reordering and Interleaving of Code

开发者 https://www.devze.com 2022-12-11 14:41 出处:网络
Are reordering and interleaving interchangeable开发者_开发问答 terms when it comes to code compilation, optimization and execution?I\'d say they describe a similar technique but mean something else at

Are reordering and interleaving interchangeable开发者_开发问答 terms when it comes to code compilation, optimization and execution?


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.


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).

0

精彩评论

暂无评论...
验证码 换一张
取 消