summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCFastISel.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2018-12-17 17:25:53 +0000
committerTim Northover <tnorthover@apple.com>2018-12-17 17:25:53 +0000
commit256a16d0314c78b0ee3612e01d0cafbf6c83de7b (patch)
treeac50144a309aa5c7f1387e827ab9c582c9be4055 /llvm/lib/Target/PowerPC/PPCFastISel.cpp
parent2d6833c9c9e447e5a0a5fa0b0fa9db18b3dd8111 (diff)
downloadbcm5719-llvm-256a16d0314c78b0ee3612e01d0cafbf6c83de7b.tar.gz
bcm5719-llvm-256a16d0314c78b0ee3612e01d0cafbf6c83de7b.zip
FastIsel: take care to update iterators when removing instructions.
We keep a few iterators into the basic block we're selecting while performing FastISel. Usually this is fine, but occasionally code wants to remove already-emitted instructions. When this happens we have to be careful to update those iterators so they're not pointint at dangling memory. llvm-svn: 349365
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCFastISel.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCFastISel.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCFastISel.cpp b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
index 668169839e7..aa55ac1f7ac 100644
--- a/llvm/lib/Target/PowerPC/PPCFastISel.cpp
+++ b/llvm/lib/Target/PowerPC/PPCFastISel.cpp
@@ -2354,7 +2354,8 @@ bool PPCFastISel::tryToFoldLoadIntoMI(MachineInstr *MI, unsigned OpNo,
PPCSubTarget->hasSPE() ? PPC::EVLDD : PPC::LFD))
return false;
- MI->eraseFromParent();
+ MachineBasicBlock::iterator I(MI);
+ removeDeadCode(I, std::next(I));
return true;
}
OpenPOWER on IntegriCloud