Implement non-trivial LoopUnswitching with FunctionPass. Since non-trivial LoopUnswitching may rely on Function Analysis, it's better be implemented based on FuncPass.
It seems the loop pass in the new PM already has an option to perform non-trivial unswitching, the purpose of this pass is not clear. Doesn't the core function unswitchLoop() use the same analyses in both cases? Does the function pass use an analysis that is not in the LoopStandardAnalysisResults?
Is there a better way to name this option? The function pass feels like an implementation detail. Is there something else that conveys the significance?
The body of this pass closely resembles the loop pass, but the state is too mixed up to refactor. But at least this part with the string literals deserves to be commoned out.
this was done for https://discourse.llvm.org/t/rfc-re-implement-non-trivial-simpleloopunswitch-with-functionpass/62937, which we're no longer pursuing
we should probably abandon this patch
This patch implements SimpleLoopUnswitch using FuncPass, which can be used to replace the LoopPass implementation currently used in the optimization pipeline.
This patch has been verified and can be re-opened once we find using FuncPass for SLU is necessary/beneficial.