Fixes PR42445 (-Os -Oz translate to -plugin-opt=Os (Oz) which cannot be
recognized by LLVMgold.so or LLD).
The optimization level mapping matches
CompilerInvocation.cpp:getOptimizationLevel() and SpeedLevel of
PassBuilder::OptimizationLevel::O*.
-plugin-opt=O* affects the way we construct regular LTO/ThinLTO pass
manager pipeline.
I think this one should be --check-prefix=O2.