[DFAJumpThreading] Extend to simplifying multiple switches.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
DFAJumpThreading handles only one threadable switch at a time for now, due to some correctness problems. We could try to extend the implementation to handle multiple switches. There are two possible solutions in my mind now:
The first is:
- Skip collecting the switches that have overlapped blocks with other collected switches.
- Thread collected switches together at last. In this way, we don't need to update invalid loop info.
The second is:
- Get rid of the loop info query in this pass, and still keep compile-time good.
- Iteratively collect and thread only one switch at a time until no threadable switches exist.
Contributor guide
Research direction
Start by locating the DFAJumpThreading implementation and its existing handling for a single threadable switch. Compare the two proposed approaches, including their effects on overlapping blocks, loop information, and compile time. Done means multiple switches can be simplified without correctness regressions, with relevant compiler tests passing.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100