Code cleanup following CR by Duncan.

llvm-svn: 151627
This commit is contained in:
Nadav Rotem 2012-02-28 14:13:19 +00:00
parent 875e463b19
commit 1d666099be
1 changed files with 3 additions and 5 deletions

View File

@ -3077,11 +3077,9 @@ void SelectionDAGBuilder::visitExtractValue(const ExtractValueInst &I) {
void SelectionDAGBuilder::visitGetElementPtr(const User &I) {
SDValue N = getValue(I.getOperand(0));
Type *Ty = I.getOperand(0)->getType();
// If this is a vector of pointers, use the size of the
// vector element and not the size of the pointer.
if (VectorType *VTy = dyn_cast<VectorType>(Ty))
Ty = VTy->getElementType();
// Note that the pointer operand may be a vector of pointers. Take the scalar
// element which holds a pointer.
Type *Ty = I.getOperand(0)->getType()->getScalarType();
for (GetElementPtrInst::const_op_iterator OI = I.op_begin()+1, E = I.op_end();
OI != E; ++OI) {