summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-17 06:19:06 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2014-07-17 06:19:06 +0000
commitac6e39cf3bee83b7e6a258befe2e3b188801bfe3 (patch)
tree851b3585bf711ce7315b71a5d8a7035bdd0825b0
parent5e2b0f51e7032895bf3f83707b348e2d8c073a42 (diff)
downloadbcm5719-llvm-ac6e39cf3bee83b7e6a258befe2e3b188801bfe3.tar.gz
bcm5719-llvm-ac6e39cf3bee83b7e6a258befe2e3b188801bfe3.zip
Use range for
llvm-svn: 213230
-rw-r--r--llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
index f90b92f7c94..2d934a4cb09 100644
--- a/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
+++ b/llvm/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
@@ -95,14 +95,12 @@ bool AMDGPUTTI::hasBranchDivergence() const { return true; }
void AMDGPUTTI::getUnrollingPreferences(Loop *L,
UnrollingPreferences &UP) const {
- for (Loop::block_iterator BI = L->block_begin(), BE = L->block_end();
- BI != BE; ++BI) {
- BasicBlock *BB = *BI;
- for (BasicBlock::const_iterator I = BB->begin(), E = BB->end();
- I != E; ++I) {
- const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(I);
+ for (const BasicBlock *BB : L->getBlocks()) {
+ for (const Instruction &I : *BB) {
+ const GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(&I);
if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS)
continue;
+
const Value *Ptr = GEP->getPointerOperand();
const AllocaInst *Alloca = dyn_cast<AllocaInst>(GetUnderlyingObject(Ptr));
if (Alloca) {
OpenPOWER on IntegriCloud