diff --git a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp index ea78f431588..f90b92f7c94 100644 --- a/lib/Target/R600/AMDGPUTargetTransformInfo.cpp +++ b/lib/Target/R600/AMDGPUTargetTransformInfo.cpp @@ -101,7 +101,7 @@ void AMDGPUTTI::getUnrollingPreferences(Loop *L, for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I != E; ++I) { const GetElementPtrInst *GEP = dyn_cast(I); - if (!GEP) + if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS) continue; const Value *Ptr = GEP->getPointerOperand(); const AllocaInst *Alloca = dyn_cast(GetUnderlyingObject(Ptr));