gchatelet added a comment. AFAIU here is a coarse plan of what needs to happen
1. Add a `no-builtin` clang function attribute that has the same semantic as the `no-builtin` cmd line argument <https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-fbuiltin> 2. Propagate it to the IR. - In the light of recent discussions and as @theraven suggested it seems more appropriate to encode them as individual IR attributes (e.g. `"no-builtin-memcpy"`, `"no-builtin-sqrt"`, etc..) 3. Propagate/merge the `no-builtin` IR attribute for LTO by "updating `AttributeFuncs::areInlineCompatible` and/or `AttributeFuncs::mergeAttributesForInlining` and adding a new MergeRule in `include/llvm/IR/Attributes.td` and writing a function like `adjustCallerStackProbeSize`." 4. Get inspiration from `TargetTransformInfo` to get `TargetLibraryInfo` on a per function basis for all passes and respect the IR attribute. I'm not familiar with 3 and 4 but I can definitely have a look. I'll update this patch to do 1 and 2 in the meantime. @tejohnson let me know how you want to proceed for your related patch <https://reviews.llvm.org/D60162>. I'm happy to help if I can. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D61634/new/ https://reviews.llvm.org/D61634 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits