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

Sameer Sahasrabuddhe via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 21 23:14:08 PDT 2023


sameerds added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:441
+  if (PrintfFunction->hasFnAttribute(Attribute::NoBuiltin) &&
+      !PrintfFunction->hasFnAttribute(Attribute::Builtin))
+    return false;
----------------
Attribute::Builtin is documented as "only valid on a callsite", so there shouldn't be any need to check it here?


================
Comment at: llvm/test/CodeGen/AMDGPU/printf_nobuiltin.ll:18
+
+define void @caller_builtin(i32 %n) {
+; GCN-LABEL: define void @caller_builtin
----------------
There should be another test where "-fno-builtin" is passed or equivalently, printf is declared with nobuiltin, but then an over-riding "builtin" is specified on a call to printf.


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