diff options
| author | Jakub Staszak <kubastaszak@gmail.com> | 2012-11-01 01:10:43 +0000 |
|---|---|---|
| committer | Jakub Staszak <kubastaszak@gmail.com> | 2012-11-01 01:10:43 +0000 |
| commit | 4e45abf0aeb7957e1bd7b58785383d0d753c9e23 (patch) | |
| tree | 9a535534e0e3669775104e80586b79d4a16bfde1 /llvm/lib/Transforms | |
| parent | a4a9b3691d62d63285e8be4e6832e1a7221ffa31 (diff) | |
| download | bcm5719-llvm-4e45abf0aeb7957e1bd7b58785383d0d753c9e23.tar.gz bcm5719-llvm-4e45abf0aeb7957e1bd7b58785383d0d753c9e23.zip | |
Don't insert and erase load instruction. Simply create (new) and delete it.
llvm-svn: 167196
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 1d0ba1c2c16..428aa8a472d 100644 --- a/llvm/lib/Transforms/Scalar/SROA.cpp +++ b/llvm/lib/Transforms/Scalar/SROA.cpp @@ -2521,12 +2521,12 @@ private: // the computed value, and then replace the placeholder with LI, leaving // LI only used for this computation. Value *Placeholder - = IRB.CreateLoad(UndefValue::get(LI.getType()->getPointerTo())); + = new LoadInst(UndefValue::get(LI.getType()->getPointerTo())); V = insertInteger(TD, IRB, Placeholder, V, BeginOffset, getName(".insert")); LI.replaceAllUsesWith(V); Placeholder->replaceAllUsesWith(&LI); - cast<Instruction>(Placeholder)->eraseFromParent(); + delete Placeholder; if (Pass.DeadSplitInsts.insert(&LI)) Pass.DeadInsts.push_back(&LI); DEBUG(dbgs() << " to: " << *V << "\n"); |

