[llvm-dev] "Replace locked IO with unlocked IO" optimizations

Friedman, Eli via llvm-dev llvm-dev at lists.llvm.org
Tue May 8 17:13:11 PDT 2018


It's probably worth going into a little more detail... a lot of people 
read llvmdev, and most of them won't click the link or follow the whole 
discussion.

The transform in question is replacing "fputc(...)" with 
"fputc_unlocked(...)" when we can prove the FILE* doesn't escape. The 
question is whether it's safe for the compiler to emit a call to 
fputc_unlocked() on Linux, given it's a non-standard extension.  The bit 
I'm most worried about is some user defining a function named 
fputc_unlocked; it isn't a reserved name according to the C standard, so 
there's no way to ensure we're actually calling the glibc fputc_unlocked.

Suggestions welcome.

-Eli

On 5/8/2018 4:59 PM, Dávid Bolvanský via llvm-dev wrote:
> Hello,
>
> Please check this patch:
> https://reviews.llvm.org/D45736
>
> as Eli noted, other opinions are highly welcomed..
>
> Thanks
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


-- 
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180508/bbec21ed/attachment.html>


More information about the llvm-dev mailing list