Simplify.
authorNick Lewycky <nicholas@mxc.ca>
Tue, 10 Nov 2009 07:00:43 +0000 (07:00 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Tue, 10 Nov 2009 07:00:43 +0000 (07:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86668 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/DeadStoreElimination.cpp

index a85cf7b28b54a28e524e346cbed2443885353865..4dd0e91f9089326f34c04495b20f8fe082d5373b 100644 (file)
@@ -121,9 +121,7 @@ static unsigned getStoreSize(Instruction *I, const TargetData *TD) {
   assert(doesClobberMemory(I));
   if (StoreInst *SI = dyn_cast<StoreInst>(I)) {
     if (!TD) return -1u;
-    const PointerType *PTy =
-        cast<PointerType>(SI->getPointerOperand()->getType());
-    return TD->getTypeStoreSize(PTy->getElementType());
+    return TD->getTypeStoreSize(SI->getOperand(0)->getType());
   }
 
   Value *Len;