Load data from memory well before the program needs it, and thus to effectively minimize the impact of memory latency.
Speculative loading is a combination of compile-time and run-time optimizations. ? compiler-controlled speculation
The compiler is looking for any instructions that will need data from memory and, whenever possible, hoists a load at an earlier point in the instruction stream, ahead of the instruction that will actually use the data.
Today's superscalar processors:
- load can be hoisted up to the first branch instruction which represents a barrier
Speculative loading combined with predication gives the compiler more flexibility to reorder instructions and to shift loads above branches.