diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-11 09:05:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-11 09:05:13 +0000 |
commit | 3802c2552fe4475418db3c948e7601d7259f996d (patch) | |
tree | 808bd41ffc1722820297ef594131c97583b23138 /lib/CodeGen | |
parent | 3aed79eadbea1dc066890e11ee569f4cf42e15a9 (diff) | |
download | external_llvm-3802c2552fe4475418db3c948e7601d7259f996d.zip external_llvm-3802c2552fe4475418db3c948e7601d7259f996d.tar.gz external_llvm-3802c2552fe4475418db3c948e7601d7259f996d.tar.bz2 |
Minor tweak to get isel opt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24663 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 23a9954..0630fd3 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -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. |