[PATCH] D67923: [TLI] Support for per-Function TLI that overrides available libfuncs

Guillaume Chatelet via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 15 03:56:04 PST 2019


gchatelet accepted this revision.
gchatelet added a comment.

Thx !



================
Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:227
+      const TargetLibraryInfoImpl &Impl,
+      LLVM_ATTRIBUTE_UNUSED Optional<const Function *> F = None)
+      : Impl(&Impl), OverrideAsUnavailable(NumLibFuncs) {
----------------
I don't think you need the `LLVM_ATTRIBUTE_UNUSED` here


================
Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:229
+      : Impl(&Impl), OverrideAsUnavailable(NumLibFuncs) {
+    if (F) {
+      if ((*F)->hasFnAttribute("no-builtins"))
----------------
[optional] rewrite as `if (!F) return;` to reduce nesting depth.


================
Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:236
+        AttributeSet FnAttrs = (*F)->getAttributes().getFnAttributes();
+        std::string Prefix = "no-builtin-";
+        for (const Attribute &Attr : FnAttrs) {
----------------
Inline so you don't allocate the string (`consumeFront` takes a `StringRef`)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67923/new/

https://reviews.llvm.org/D67923





More information about the cfe-commits mailing list