Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 7,675 Lines • ▼ Show 20 Lines | void AAMemoryLocationImpl::categorizePtrValue( | ||||||||
for (Value *Obj : Objects) { | for (Value *Obj : Objects) { | ||||||||
// TODO: recognize the TBAA used for constant accesses. | // TODO: recognize the TBAA used for constant accesses. | ||||||||
MemoryLocationsKind MLK = NO_LOCATIONS; | MemoryLocationsKind MLK = NO_LOCATIONS; | ||||||||
assert(!isa<GEPOperator>(Obj) && "GEPs should have been stripped."); | assert(!isa<GEPOperator>(Obj) && "GEPs should have been stripped."); | ||||||||
if (isa<UndefValue>(Obj)) | if (isa<UndefValue>(Obj)) | ||||||||
continue; | continue; | ||||||||
if (auto *Arg = dyn_cast<Argument>(Obj)) { | if (auto *Arg = dyn_cast<Argument>(Obj)) { | ||||||||
if (Arg->hasByValAttr()) | // TODO: For now we do not treat byval arguments as local copies performed | ||||||||
MLK = NO_LOCAL_MEM; | // on the call edge, though, we should. To make that happen we need to | ||||||||
else | // teach various passes, e.g., DSE, about the copy effect of a byval. That | ||||||||
// would also allow us to mark functions only accessing byval arguments as | |||||||||
// readnone again, atguably their acceses have no effect outside of the | |||||||||
mlychkovUnsubmitted Not Done ReplyInline Actions
mlychkov: | |||||||||
Not Done ReplyInline ActionsThe same typos are in commit message. mlychkov: The same typos are in commit message. | |||||||||
// function, like accesses to allocas. | |||||||||
MLK = NO_ARGUMENT_MEM; | MLK = NO_ARGUMENT_MEM; | ||||||||
} else if (auto *GV = dyn_cast<GlobalValue>(Obj)) { | } else if (auto *GV = dyn_cast<GlobalValue>(Obj)) { | ||||||||
// Reading constant memory is not treated as a read "effect" by the | // Reading constant memory is not treated as a read "effect" by the | ||||||||
// function attr pass so we won't neither. Constants defined by TBAA are | // function attr pass so we won't neither. Constants defined by TBAA are | ||||||||
// similar. (We know we do not write it because it is constant.) | // similar. (We know we do not write it because it is constant.) | ||||||||
if (auto *GVar = dyn_cast<GlobalVariable>(GV)) | if (auto *GVar = dyn_cast<GlobalVariable>(GV)) | ||||||||
if (GVar->isConstant()) | if (GVar->isConstant()) | ||||||||
continue; | continue; | ||||||||
▲ Show 20 Lines • Show All 2,050 Lines • Show Last 20 Lines |