diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index 0869114e7f7a..683fab5cb651 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -3726,7 +3726,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { continue; } - Instruction *StoreBasePtr = cast(SI->getPointerOperand()); + Value *StoreBasePtr = SI->getPointerOperand(); IRB.SetInsertPoint(BasicBlock::iterator(SI)); DEBUG(dbgs() << " Splitting store of load: " << *SI << "\n"); @@ -3789,7 +3789,7 @@ bool SROA::presplitLoadsAndStores(AllocaInst &AI, AllocaSlices &AS) { assert(BaseOffset + StoreSize > BaseOffset && "Cannot represent alloca access size using 64-bit integers!"); - Instruction *LoadBasePtr = cast(LI->getPointerOperand()); + Value *LoadBasePtr = LI->getPointerOperand(); Instruction *StoreBasePtr = cast(SI->getPointerOperand()); DEBUG(dbgs() << " Splitting store: " << *SI << "\n");