Skip to content

Commit f58b06d

Browse files
authored
Revert "AMDGPU: Fix runtime unrolling when cascaded GEPs present (llvm#147700)" (#1348)
2 parents cc52590 + ae1c7a3 commit f58b06d

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
@@ -217,13 +217,10 @@ void AMDGPUTTIImpl::getUnrollingPreferences(
217217
// a variable, most likely we will be unable to combine it.
218218
// Do not unroll too deep inner loops for local memory to give a chance
219219
// to unroll an outer loop for a more important reason.
220-
if (LocalGEPsSeen > 1 || L->getLoopDepth() > 2)
220+
if (LocalGEPsSeen > 1 || L->getLoopDepth() > 2 ||
221+
(!isa<GlobalVariable>(GEP->getPointerOperand()) &&
222+
!isa<Argument>(GEP->getPointerOperand())))
221223
continue;
222-
223-
const Value *V = getUnderlyingObject(GEP->getPointerOperand());
224-
if (!isa<GlobalVariable>(V) && !isa<Argument>(V))
225-
continue;
226-
227224
LLVM_DEBUG(dbgs() << "Allow unroll runtime for loop:\n"
228225
<< *L << " due to LDS use.\n");
229226
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)