@@ -822,25 +822,30 @@ void MemorySSAUpdater::applyUpdates(ArrayRef<CFGUpdate> Updates,
822
822
}
823
823
824
824
if (!DeleteUpdates.empty ()) {
825
- if (!UpdateDT) {
826
- SmallVector<CFGUpdate, 0 > Empty;
827
- // Deletes are reversed applied, because this CFGView is pretending the
828
- // deletes did not happen yet, hence the edges still exist.
829
- DT.applyUpdates (Empty, RevDeleteUpdates);
825
+ if (!InsertUpdates.empty ()) {
826
+ if (!UpdateDT) {
827
+ SmallVector<CFGUpdate, 0 > Empty;
828
+ // Deletes are reversed applied, because this CFGView is pretending the
829
+ // deletes did not happen yet, hence the edges still exist.
830
+ DT.applyUpdates (Empty, RevDeleteUpdates);
831
+ } else {
832
+ // Apply all updates, with the RevDeleteUpdates as PostCFGView.
833
+ DT.applyUpdates (Updates, RevDeleteUpdates);
834
+ }
835
+
836
+ // Note: the MSSA update below doesn't distinguish between a GD with
837
+ // (RevDelete,false) and (Delete, true), but this matters for the DT
838
+ // updates above; for "children" purposes they are equivalent; but the
839
+ // updates themselves convey the desired update, used inside DT only.
840
+ GraphDiff<BasicBlock *> GD (RevDeleteUpdates);
841
+ applyInsertUpdates (InsertUpdates, DT, &GD);
842
+ // Update DT to redelete edges; this matches the real CFG so we can
843
+ // perform the standard update without a postview of the CFG.
844
+ DT.applyUpdates (DeleteUpdates);
830
845
} else {
831
- // Apply all updates, with the RevDeleteUpdates as PostCFGView.
832
- DT.applyUpdates (Updates, RevDeleteUpdates );
846
+ if (UpdateDT)
847
+ DT.applyUpdates (DeleteUpdates );
833
848
}
834
-
835
- // Note: the MSSA update below doesn't distinguish between a GD with
836
- // (RevDelete,false) and (Delete, true), but this matters for the DT
837
- // updates above; for "children" purposes they are equivalent; but the
838
- // updates themselves convey the desired update, used inside DT only.
839
- GraphDiff<BasicBlock *> GD (RevDeleteUpdates);
840
- applyInsertUpdates (InsertUpdates, DT, &GD);
841
- // Update DT to redelete edges; this matches the real CFG so we can perform
842
- // the standard update without a postview of the CFG.
843
- DT.applyUpdates (DeleteUpdates);
844
849
} else {
845
850
if (UpdateDT)
846
851
DT.applyUpdates (Updates);
0 commit comments