Before this change LLVM cannot simplify printf in following cases:
printf("%s", "") --> noop printf("%s", str"\n") --> puts(str)
From the other hand GCC can perform such transformations for many years:
https://godbolt.org/z/7nnqbedfe
Differential D100724
[SimplifyLibCalls] Transform printf("%s", str) --> puts(str)/noop. yurai007 on Apr 18 2021, 5:50 AM. Authored by
Details Before this change LLVM cannot simplify printf in following cases: printf("%s", "") --> noop printf("%s", str"\n") --> puts(str) From the other hand GCC can perform such transformations for many years:
Diff Detail
Event TimelineComment Actions Looks fine
Comment Actions @lebedev.ri @xbolva00: Kindly ping :) All comments were addressed. If there is anything more to do please let me know.
Comment Actions LGTM - it would be a slight improvement to add the tests first with baseline checks, so we just have the diffs here.
Comment Actions @xbolva00: Thanks for looking into https://reviews.llvm.org/D101176! However my ping was about parallel, accepted change: https://reviews.llvm.org/D100724 which I cannot push myself as I don't have permission. Comment Actions Is this the correct email address to attribute as patch author? |
Why is this checking for args > 1 instead of exactly args == 2?