Sufficiently Smart Compilers™ exist, but they are called GPU drivers and GPGPU compute platforms.
1) They can adapt to variable-latency memory operations, because they aren't an ahead-of-time compiler.
2) They can adapt to the capabilities of the hardware they're running on, because they ARE the hardware.
In reality of course you don’t even know the precise configuration of the computer, and you don’t know the exact usage pattern of the software. Even if you do profile guided optimization, someone could use the software with different data that causes different branch patterns than in the profile, and then it runs slow. A branch predictor will notice this at runtime and compensate automatically.
Well, I'm clumsy...