Would it be any practical benefit to write a cloud-based compiler, that would spread compiled units of code on different machines in the cloud? Could there be a benefit from obtaining a software-as-a-service architecture right within the app just after compiling, or would the inherent latency make such an approach impractical?
I'm not sure if I've misunderstood your point or if the other answers have. Are you talking about some sort of automatic parallelisation task? The answers given so far appear to be talking about distributed compilation - i.e. using a cloud to speed up compilation times. I assumed you were instead talking about a compiler that targets cloud computing resources.
If you were in fact talking about distributed compilation, then obviously things like distcc will do what you need.
If you were asking the much more interesting (IMHO) question about whether a compiler that targets distributed architectures would be useful, my answer is a resounding 'yes'. However, feasibility is at the heart of the problem. Latency is not the problem as such, however coherence (i.e. ensuring that the correct versions of all the units are in place) and having decent heuristics would be an issue.
The best place to look would probably be the Occam programming language - it targeted the transputer, which was not entirely dissimilar to the kinds of distributed systems architectures we're interested in these days. I believe there is some work that follows on from Occam that might provide useful clues as to what the state of the art is.