Skip to content

Commit 5e2093d

Browse files
authored
Revert "AMDGPU: Fix runtime unrolling when cascaded GEPs present (llvm#147700)" (llvm#3145)
2 parents e13573e + 579872b commit 5e2093d

File tree

2 files changed

+3
-70
lines changed

2 files changed

+3
-70
lines changed

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,10 @@ void AMDGPUTTIImpl::getUnrollingPreferences(Loop *L, ScalarEvolution &SE,
216216
// a variable, most likely we will be unable to combine it.
217217
// Do not unroll too deep inner loops for local memory to give a chance
218218
// to unroll an outer loop for a more important reason.
219-
if (LocalGEPsSeen > 1 || L->getLoopDepth() > 2)
219+
if (LocalGEPsSeen > 1 || L->getLoopDepth() > 2 ||
220+
(!isa<GlobalVariable>(GEP->getPointerOperand()) &&
221+
!isa<Argument>(GEP->getPointerOperand())))
220222
continue;
221-
222-
const Value *V = getUnderlyingObject(GEP->getPointerOperand());
223-
if (!isa<GlobalVariable>(V) && !isa<Argument>(V))
224-
continue;
225-
226223
LLVM_DEBUG(dbgs() << "Allow unroll runtime for loop:\n"
227224
<< *L << " due to LDS use.\n");
228225
UP.Runtime = UnrollRuntimeLocal;

llvm/test/Transforms/LoopUnroll/AMDGPU/unroll-runtime.ll

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)