We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
HoistCongruentPHI
1 parent 82a7975 commit a060a9aCopy full SHA for a060a9a
IGC/Compiler/CISACodeGen/HoistCongruentPhi.cpp
@@ -301,9 +301,14 @@ bool HoistCongruentPHI::hoistCongruentPhi(PHINode *phi) {
301
// below to not invalidate the `insertPos` that may also
302
// be in the `instMap`
303
}
304
+ std::set<Instruction *> removed;
305
for (auto &insts : instMap) {
- insts.first->eraseFromParent();
306
- insts.second->eraseFromParent();
+ if (removed.insert(insts.first).second) {
307
+ insts.first->eraseFromParent();
308
+ }
309
+ if (removed.insert(insts.second).second) {
310
+ insts.second->eraseFromParent();
311
312
313
changed = true;
314
0 commit comments