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