reames added a comment. I think I've found a better fix for this issue. I'm working on a patch for CGP which lets it cleanup the phi cycles introduced by the simple rematerialization. Assuming that works out, I'll abandon this patch. http://reviews.llvm.org/D16435