efriedma added a comment. I don't see anything wrong with the patch, exactly... but we probably need to fix TargetTransformInfo::isLoweredToCall to correctly handle intrinsics before we merge this. https://reviews.llvm.org/D41104