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 | 5801ff93e3b81ee18fdd57f59d0e776ac3b27384 (patch) | |
tree | f4158b10b02e7d69ae7186c0ea0dff5fb32ed95b /lib/Transforms/Scalar/SROA.cpp | |
parent | 647d6d7d3b6bfc8d99b8425cff50f979dbbd2ab6 (diff) | |
download | external_llvm-5801ff93e3b81ee18fdd57f59d0e776ac3b27384.zip external_llvm-5801ff93e3b81ee18fdd57f59d0e776ac3b27384.tar.gz external_llvm-5801ff93e3b81ee18fdd57f59d0e776ac3b27384.tar.bz2 |
Don't insert and erase load instruction. Simply create (new) and delete it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167196 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/SROA.cpp')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp index 1d0ba1c..428aa8a 100644 --- a/lib/Transforms/Scalar/SROA.cpp +++ b/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"); |