diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-01-01 23:26:16 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-01-01 23:26:16 +0000 |
commit | c39eaa50411d1e90065564a912cc420c2733bf6a (patch) | |
tree | a3078c2d7cfe142f48da20b8e43802ea40af3dbb /llvm/lib/Transforms | |
parent | 3f29619614336c599b53a58f4822e0a400d6bb9a (diff) | |
download | bcm5719-llvm-c39eaa50411d1e90065564a912cc420c2733bf6a.tar.gz bcm5719-llvm-c39eaa50411d1e90065564a912cc420c2733bf6a.zip |
[SROA] Fix two total think-os in r225061 that should have been caught on
a +asserts bootstrap, but my bootstrap had asserts off. Oops.
Anyways, in some places it is reasonable to cast (as a sanity check) the
pointer operand to a load or store to an instruction within SROA --
namely when the pointer operand is expected to be derived from an
alloca, and thus always an instruction. However, the pre-splitting code
also deals with loads and stores to non-alloca pointers and there we
need to just use the Value*. Nothing about the code relied on the
instruction cast, it was only there essentially as an invariant
assertion. Remove the two that don't actually hold.
This should fix the proximate issue in PR22080, but I'm also doing an
asserts bootstrap myself to see if there are other issues lurking.
I'll craft a reduced test case in a moment, but I wanted to get the tree
healthy as quickly as possible.
llvm-svn: 225068
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/SROA.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/SROA.cpp b/llvm/lib/Transforms/Scalar/SROA.cpp index 0869114e7f7..683fab5cb65 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<Instruction>(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<Instruction>(LI->getPointerOperand()); + Value *LoadBasePtr = LI->getPointerOperand(); Instruction *StoreBasePtr = cast<Instruction>(SI->getPointerOperand()); DEBUG(dbgs() << " Splitting store: " << *SI << "\n"); |