Simplify expression
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 13 Mar 2015 21:03:30 +0000 (21:03 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 13 Mar 2015 21:03:30 +0000 (21:03 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232214 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Instructions.h

index a737e5634076bf07d1b9fd7fe5fcae37963e5a94..1ae1757850606e0dc4de9b1f19bfc403ed62d528 100644 (file)
@@ -846,10 +846,8 @@ public:
   }
 
   Type *getSourceElementType() const {
-    SequentialType *Ty = cast<SequentialType>(getPointerOperandType());
-    if (VectorType *VTy = dyn_cast<VectorType>(Ty))
-      Ty = cast<SequentialType>(VTy->getElementType());
-    return Ty->getElementType();
+    return cast<SequentialType>(getPointerOperandType()->getScalarType())
+        ->getElementType();
   }
 
   /// \brief Returns the address space of this instruction's pointer type.