diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -996,13 +996,9 @@ } } - // If the call is malloc/calloc like, we can assume that it doesn't - // modify any IR visible value. This is only valid because we assume these - // routines do not read values visible in the IR. TODO: Consider special - // casing realloc and strdup routines which access only their arguments as - // well. Or alternatively, replace all of this with inaccessiblememonly once - // that's implemented fully. - if (isMallocOrCallocLikeFn(Call, &TLI)) { + // TODO: Consider using inaccessiblememorargmemonly to allow for functions + // like realloc and strdup which access only their arguments as well. + if (Call->onlyAccessesInaccessibleMemory()) { // Be conservative if the accessed pointer may alias the allocation - // fallback to the generic handling below. if (getBestAAResults().alias(MemoryLocation::getBeforeOrAfter(Call), Loc,