Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ static cl::opt<bool> ManifestInternal(

static cl::opt<int> MaxHeapToStackSize("max-heap-to-stack-size", cl::init(128),
cl::Hidden);
static cl::opt<unsigned> MaxAccessesPerAAPointerInfo(
"attributor-max-pi-accesses", cl::Hidden,
cl::desc("Maximum number of accesses in a single AAPointerInfo instance "
"before going pessimistic (0 = unlimited)"),
cl::init(512));

template <>
unsigned llvm::PotentialConstantIntValuesState::MaxPotentialValues = 0;
Expand Down Expand Up @@ -938,6 +943,10 @@ ChangeStatus AA::PointerInfo::State::addAccess(
Attributor &A, const AAPointerInfo::RangeList &Ranges, Instruction &I,
std::optional<Value *> Content, AAPointerInfo::AccessKind Kind, Type *Ty,
Instruction *RemoteI) {
if (MaxAccessesPerAAPointerInfo > 0 &&
AccessList.size() >= MaxAccessesPerAAPointerInfo)
return indicatePessimisticFixpoint();

RemoteI = RemoteI ? RemoteI : &I;

// Check if we have an access for this instruction, if not, simply add it.
Expand Down
Loading