Skip to content

Commit

Permalink
Revert "[SROA] Limit the number of allowed slices when trying to spli…
Browse files Browse the repository at this point in the history
…t allocas"

This reverts commit e13e808.

This causes performance regressions on GPU targets, see
#69785. Revert the
change for now.
  • Loading branch information
nikic committed Nov 9, 2023
1 parent b002b38 commit ed86e74
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 185 deletions.
11 changes: 0 additions & 11 deletions llvm/lib/Transforms/Scalar/SROA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ static cl::opt<bool> SROAStrictInbounds("sroa-strict-inbounds", cl::init(false),
/// Disable running mem2reg during SROA in order to test or debug SROA.
static cl::opt<bool> SROASkipMem2Reg("sroa-skip-mem2reg", cl::init(false),
cl::Hidden);

/// The maximum number of alloca slices allowed when splitting.
static cl::opt<int>
SROAMaxAllocaSlices("sroa-max-alloca-slices", cl::init(1024),
cl::desc("Maximum number of alloca slices allowed "
"after which splitting is not attempted"),
cl::Hidden);

namespace {

/// Calculate the fragment of a variable to use when slicing a store
Expand Down Expand Up @@ -4953,9 +4945,6 @@ SROAPass::runOnAlloca(AllocaInst &AI) {
if (AS.isEscaped())
return {Changed, CFGChanged};

if (std::distance(AS.begin(), AS.end()) > SROAMaxAllocaSlices)
return {Changed, CFGChanged};

// Delete all the dead users of this alloca before splitting and rewriting it.
for (Instruction *DeadUser : AS.getDeadUsers()) {
// Free up everything used by this instruction.
Expand Down
174 changes: 0 additions & 174 deletions llvm/test/Transforms/SROA/huge-size.ll

This file was deleted.

0 comments on commit ed86e74

Please sign in to comment.