The 2.12 / 2.13 optimizer implementation is independent of the compiler’s frontend representation (Types / Symbols / ASTs), it works on the bytecode representation. Some metadata that is useful for the optimizer but not represented in the bytecode is stored in classfiles as a separate attribute (InlineInfoAttribute). This allows the optimizer to work with classfiles without looking at the “pickle”, the serialized symbol table (what would be Tasty on Scala 3).
This setup would allow adding the optimzier to the Scala 3 compiler relatively easily.
The code could also be used as a basis for implementing a compiler-independent optimizer (linker). I believe this would be a better way forward because the linker can make a closed-world assumption. This makes many more methods effectively final (methods that don’t have any overrides in the code being optimized), which enables inlining. Also unused code / classes can be removed, which makes more methods effectively final.
For Scala 3, a linker based on Tasty is also a viable option.