wenju-he wrote: Unfortunately weak linkage prevents PostOrderFunctionAttrsPass from deducing attributes for functions that have weak linkage: https://github.com/llvm/llvm-project/blob/7624c6141974f66f24ea90a18a55a111e98baa40/llvm/lib/Transforms/IPO/FunctionAttrs.cpp#L285 where hasExactDefinition returns false for weak linkage.
weak_odr probably suits libclc and it can enables optimization in PostOrderFunctionAttrsPass. However, there is no corresponding clang attribute, i.e. __attribute__(weak_odr) isn't available. https://github.com/llvm/llvm-project/pull/156378 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits