[PATCH] D100724: [SimplifyLibCalls] Transform printf("%s", str"\n") --> puts(str).
Dawid Jurczak via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 18 08:51:24 PDT 2021
yurai007 marked an inline comment as done.
yurai007 added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/printf-2.ll:76
+ %str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
+ call void (i8*, ...) @printf(i8* %fmt, i8* %str)
+ ret void
----------------
lebedev.ri wrote:
> This does't fire when `@printf` returns the status, and/or when that status is used, right?
That's right. Currently we run all kinds of printf -> puts/putchar transformations only when printf has no users. OptimizePrintFString checks that at beginning.
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