Minor tweak to get isel opt
authorChris Lattner <sabre@nondot.org>
Sun, 11 Dec 2005 09:05:13 +0000 (09:05 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 11 Dec 2005 09:05:13 +0000 (09:05 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24663 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index 23a9954aca2848d7d2131b7fe64c806d9f0aa63b..0630fd37ef0f8e44b756238e4974baf6a0346e92 100644 (file)
@@ -1324,7 +1324,8 @@ static void OptimizeGEPExpression(GetElementPtrInst *GEPI,
         break;
       }
   }
-  if (!hasConstantIndex) return;
+  // If this is a GEP &Alloca, 0, 0, forward subst the frame index into uses.
+  if (!hasConstantIndex && !isa<AllocaInst>(GEPI->getOperand(0))) return;
   
   // Otherwise, decompose the GEP instruction into multiplies and adds.  Sum the
   // constant offset (which we now know is non-zero) and deal with it later.