[llvm] r213229 - R600: Short circuit alloca check if address space isn't private.

Matt Arsenault Matthew.Arsenault at amd.com
Wed Jul 16 23:13:42 PDT 2014


Author: arsenm
Date: Thu Jul 17 01:13:41 2014
New Revision: 213229

URL: http://llvm.org/viewvc/llvm-project?rev=213229&view=rev
Log:
R600: Short circuit alloca check if address space isn't private.

Skip calling GetUnderlyingObject in cases where it obviously
isn't from an alloca. This should only be a compile time improvement.

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUTargetTransformInfo.cpp

Modified: llvm/trunk/lib/Target/R600/AMDGPUTargetTransformInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUTargetTransformInfo.cpp?rev=213229&r1=213228&r2=213229&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUTargetTransformInfo.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUTargetTransformInfo.cpp Thu Jul 17 01:13:41 2014
@@ -101,7 +101,7 @@ void AMDGPUTTI::getUnrollingPreferences(
     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));





More information about the llvm-commits mailing list