R600: Short circuit alloca check if address space isn't private.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 17 Jul 2014 06:13:41 +0000 (06:13 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Thu, 17 Jul 2014 06:13:41 +0000 (06:13 +0000)
Skip calling GetUnderlyingObject in cases where it obviously
isn't from an alloca. This should only be a compile time improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@213229 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/R600/AMDGPUTargetTransformInfo.cpp

index ea78f431588ffa445ce87237050b785466be6eb6..f90b92f7c94873a77bc7b6ffc649094c4ec7ad62 100644 (file)
@@ -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<GetElementPtrInst>(I);
-      if (!GEP)
+      if (!GEP || GEP->getAddressSpace() != AMDGPUAS::PRIVATE_ADDRESS)
         continue;
       const Value *Ptr = GEP->getPointerOperand();
       const AllocaInst *Alloca = dyn_cast<AllocaInst>(GetUnderlyingObject(Ptr));