[llvm-commits] [poolalloc] r126474 - /poolalloc/trunk/lib/AssistDS/MergeGEP.cpp

Arushi Aggarwal aggarwa4 at illinois.edu
Thu Feb 24 20:43:48 PST 2011


Author: aggarwa4
Date: Thu Feb 24 22:43:48 2011
New Revision: 126474

URL: http://llvm.org/viewvc/llvm-project?rev=126474&view=rev
Log:
I was wrong. Constant Expression GEPs return
pointer to the type calculated, hence skip an 
offset when merging.

Modified:
    poolalloc/trunk/lib/AssistDS/MergeGEP.cpp

Modified: poolalloc/trunk/lib/AssistDS/MergeGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/MergeGEP.cpp?rev=126474&r1=126473&r2=126474&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/MergeGEP.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/MergeGEP.cpp Thu Feb 24 22:43:48 2011
@@ -94,7 +94,7 @@
         ConstantExpr *CE = cast<ConstantExpr>(C);
         SmallVector<Value*, 8> Indices;
         Indices.append(CE->op_begin()+1, CE->op_end());
-        Indices.append(GEP1->idx_begin(), GEP1->idx_end());
+        Indices.append(GEP1->idx_begin()+1, GEP1->idx_end());
         GetElementPtrInst *GEPNew = GetElementPtrInst::Create(CE->getOperand(0),
                                                               Indices.begin(),
                                                               Indices.end(),





More information about the llvm-commits mailing list