You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: Audit GetAllSuccs/GetEHSuccs when filters are involved #86538
Liveness has special logic to take into account that control may flow from filters to practically any enclosed or enclosing handler. However, GetAllSuccs does not seem to have the same handling.
// Prints 1235 in debug, 1234 in releaseusingSystem;publicclassProgram{publicstaticvoidMain(){intvalue=1234;try{try{thrownewException();}finally{Console.WriteLine(value);}}catchwhen(value++==1234){}}}
Fixing all-succ visiting is not that hard, and fixing BlockPredsWithEH also shouldn't be, but one thing I have noticed is that BlockPredsWithEH caches the "all-preds" lists. The cache never looks to be cleared and it is used by SSA, VN and CSE. We have lots of flowgraph modifying phases between CSE and and SSA, so these cached predecessors are likely out of date when we use them, which seems scary.
BlockPredsWithEH also looks pretty inefficient, so I think I will try eagerly computing the map of all-preds (using VisitAllSuccs) before the phases that need them and see what the impact of this is.
Activity
jakobbotsch commentedon May 20, 2023
cc @dotnet/jit-contrib. @AndyAyersMS you may be the best person to take a look at this.
jakobbotsch commentedon May 23, 2023
Example bad codegen:
jakobbotsch commentedon Jun 9, 2023
Fixing all-succ visiting is not that hard, and fixing
BlockPredsWithEHalso shouldn't be, but one thing I have noticed is thatBlockPredsWithEHcaches the "all-preds" lists. The cache never looks to be cleared and it is used by SSA, VN and CSE. We have lots of flowgraph modifying phases between CSE and and SSA, so these cached predecessors are likely out of date when we use them, which seems scary.BlockPredsWithEHalso looks pretty inefficient, so I think I will try eagerly computing the map of all-preds (usingVisitAllSuccs) before the phases that need them and see what the impact of this is.JIT: Fix handling of filter successors (#89275)