mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-28 22:24:28 +00:00
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
This commit is contained in:
@ -2521,12 +2521,12 @@ private:
|
|||||||
// the computed value, and then replace the placeholder with LI, leaving
|
// the computed value, and then replace the placeholder with LI, leaving
|
||||||
// LI only used for this computation.
|
// LI only used for this computation.
|
||||||
Value *Placeholder
|
Value *Placeholder
|
||||||
= IRB.CreateLoad(UndefValue::get(LI.getType()->getPointerTo()));
|
= new LoadInst(UndefValue::get(LI.getType()->getPointerTo()));
|
||||||
V = insertInteger(TD, IRB, Placeholder, V, BeginOffset,
|
V = insertInteger(TD, IRB, Placeholder, V, BeginOffset,
|
||||||
getName(".insert"));
|
getName(".insert"));
|
||||||
LI.replaceAllUsesWith(V);
|
LI.replaceAllUsesWith(V);
|
||||||
Placeholder->replaceAllUsesWith(&LI);
|
Placeholder->replaceAllUsesWith(&LI);
|
||||||
cast<Instruction>(Placeholder)->eraseFromParent();
|
delete Placeholder;
|
||||||
if (Pass.DeadSplitInsts.insert(&LI))
|
if (Pass.DeadSplitInsts.insert(&LI))
|
||||||
Pass.DeadInsts.push_back(&LI);
|
Pass.DeadInsts.push_back(&LI);
|
||||||
DEBUG(dbgs() << " to: " << *V << "\n");
|
DEBUG(dbgs() << " to: " << *V << "\n");
|
||||||
|
Reference in New Issue
Block a user