[PATCH] D100724: [SimplifyLibCalls] Transform printf("%s", str) to puts(str) or noop.

Dávid Bolvanský via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 22 06:54:57 PDT 2021


xbolva00 added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp:2387
+    if (OperandStr.empty())
+      return (Value *)CI;
+    // printf("%s", "a") --> putchar('a')
----------------
spatel wrote:
> We have seen problems before with this type of change, but I don't remember exactly how we fixed it. 
> @xbolva00 may recall. 
> Should we use eraseFromParent() to make sure that InstCombine's worklist is updated as expected?
This pattern is used from line 2368 so probably nothing to worry about.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100724



More information about the llvm-commits mailing list