@@ -158,7 +158,7 @@ class DFAJumpThreading {
158
158
void
159
159
unfoldSelectInstrs (DominatorTree *DT,
160
160
const SmallVector<SelectInstToUnfold, 4 > &SelectInsts) {
161
- DomTreeUpdater DTU (DT, DomTreeUpdater::UpdateStrategy::Eager );
161
+ DomTreeUpdater DTU (DT, DomTreeUpdater::UpdateStrategy::Lazy );
162
162
SmallVector<SelectInstToUnfold, 4 > Stack (SelectInsts);
163
163
164
164
while (!Stack.empty ()) {
@@ -975,8 +975,6 @@ struct TransformDFA {
975
975
976
976
// / Transform each threading path to effectively jump thread the DFA.
977
977
void createAllExitPaths () {
978
- DomTreeUpdater DTU (*DT, DomTreeUpdater::UpdateStrategy::Eager);
979
-
980
978
// Move the switch block to the end of the path, since it will be duplicated
981
979
BasicBlock *SwitchBlock = SwitchPaths->getSwitchBlock ();
982
980
for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ()) {
@@ -993,15 +991,18 @@ struct TransformDFA {
993
991
SmallPtrSet<BasicBlock *, 16 > BlocksToClean;
994
992
BlocksToClean.insert_range (successors (SwitchBlock));
995
993
996
- for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ()) {
997
- createExitPath (NewDefs, TPath, DuplicateMap, BlocksToClean, &DTU);
998
- NumPaths++;
999
- }
994
+ {
995
+ DomTreeUpdater DTU (*DT, DomTreeUpdater::UpdateStrategy::Lazy);
996
+ for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ()) {
997
+ createExitPath (NewDefs, TPath, DuplicateMap, BlocksToClean, &DTU);
998
+ NumPaths++;
999
+ }
1000
1000
1001
- // After all paths are cloned, now update the last successor of the cloned
1002
- // path so it skips over the switch statement
1003
- for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ())
1004
- updateLastSuccessor (TPath, DuplicateMap, &DTU);
1001
+ // After all paths are cloned, now update the last successor of the cloned
1002
+ // path so it skips over the switch statement
1003
+ for (ThreadingPath &TPath : SwitchPaths->getThreadingPaths ())
1004
+ updateLastSuccessor (TPath, DuplicateMap, &DTU);
1005
+ }
1005
1006
1006
1007
// For each instruction that was cloned and used outside, update its uses
1007
1008
updateSSA (NewDefs);
0 commit comments