[PATCH] D158477: [AMDGPU] Respect `nobuiltin` when converting `printf`

Joseph Huber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 22 07:00:12 PDT 2023


jhuber6 added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:443-445
+          (!CI->isNoBuiltin() ||
+           (CI->hasFnAttr(Attribute::Builtin) &&
+            PrintfFunction->hasFnAttribute(Attribute::NoBuiltin))))
----------------
sameerds wrote:
> But doesn't `(!CI->isNoBuiltin())` cover all of this? It calls `hasFnAttrImpl()`, which in turn checks both attributes in the positive and negative sense, including on the called function. The overall effect is as the function comment says: "check whether this call should not be treated as a builtin".
You're right, totally forgot that it checks the callee attributes as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158477



More information about the llvm-commits mailing list