Index: lib/Analysis/InlineCost.cpp =================================================================== --- lib/Analysis/InlineCost.cpp +++ lib/Analysis/InlineCost.cpp @@ -602,6 +602,11 @@ disableSROA(CostIt); } + // Implicit null checks act as unconditional branches, and + // they should be free. See the comments in visitBranchInst. + if (I.getMetadata(LLVMContext::MD_make_implicit)) + return true; + return false; }