This patch implements Chandler's idea for supporting languages that require support for infinite loops with side effects, such as Rust, providing a solution to bug 965.
Specifically, it adds an llvm.sideeffect() intrinsic, which has no actual effect, but which appears to optimization passes to have obscure side effects, such that they don't optimize away loops containing it. It also teaches several optimization passes to ignore this intrinsic, so that it doesn't significantly impact optimization in most cases.
A language that needs these is going to be inserting a lot of them; assuming a language doesn't have goto, I think the frontend needs to insert one at the beginning of every function and every loop. Is there some rule for coalescing and/or eliminating llvm.sideeffect calls which aren't necessary?