[PATCH] D68145: [AMDGPU] Make printf lowering faster when there are no printfs

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 27 10:47:43 PDT 2019


foad marked 2 inline comments as done.
foad added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:574-575
+
+  for (auto &U : PrintfFunction->uses())
+    if (auto *CI = dyn_cast<CallInst>(U.getUser()))
+      if (CI->isCallee(&U))
----------------
arsenm wrote:
> Braces
I can add braces of course (just around multi-line constructs, yeah?) but whose rule is that? I don't see it in the coding standards and clang-format didn't add them.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUPrintfRuntimeBinding.cpp:575
+  for (auto &U : PrintfFunction->uses())
+    if (auto *CI = dyn_cast<CallInst>(U.getUser()))
+      if (CI->isCallee(&U))
----------------
arsenm wrote:
> Perhaps CallSiteBase in cases printf ever ends up invoked maybe?
I did consider that but the rest of the pass seems to be assuming CallInst, so it didn't seem worth generalizing here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68145





More information about the llvm-commits mailing list