davidxl added a comment. The test case can be further simplified .. (e.g, by disabing licm with O2 -emit-llvm -S). Also make x a local variable and just test 'g', let function return x. http://reviews.llvm.org/D19950