Optimization transformations are intentionally disabled by the 'optnone' function attribute. Therefore do not warn if transformation metadata is still present.
Using the legacy pass manager structure, the skipFunction method takes core for the optnone attribute (already called before this patch). For the new pass manager, there is no equivalent, so we check for the optnone attribute manually.