Add support for vectors of pointers.
[oota-llvm.git] / lib / Transforms / Scalar / ScalarReplAggregates.cpp
index 4b14efcd063fb81cb2a35a11437696e0ce5c49f7..bc70c51cc01615efcb3612d5204718e02a184dbd 100644 (file)
@@ -453,6 +453,8 @@ bool ConvertToScalarInfo::CanConvertToScalar(Value *V, uint64_t Offset) {
 
       // Compute the offset that this GEP adds to the pointer.
       SmallVector<Value*, 8> Indices(GEP->op_begin()+1, GEP->op_end());
+      if (!GEP->getPointerOperandType()->isPointerTy())
+        return false;
       uint64_t GEPOffset = TD.getIndexedOffset(GEP->getPointerOperandType(),
                                                Indices);
       // See if all uses can be converted.