Implement non-trivial LoopUnswitching with FunctionPass. Since non-trivial LoopUnswitching may rely on Function Analysis, it's better be implemented based on FuncPass.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
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?
llvm/lib/Passes/PassRegistry.def | ||
---|---|---|
362 | 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? | |
llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp | ||
3219–3226 | 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.
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?