[cfe-dev] [llvm-dev] Disable memset synthesis

Nemanja Ivanovic via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 17 10:56:03 PDT 2017


My concern wasn't a phylosophical one but a pragmatic one. Learning about
poor choices when lowering memset is probably quite useful. Having a flag
that just turns off idiom recognition for it may just work around the
problem. But the problem may still exist.
In any case, I'm not fundamentally against such a flag but it just seems
like something that could
1. Hide a problem
2. Get a bit unwieldy - today it's memset, maybe tomorrow memcpy, etc. And
then does a single flag turn off all idiom recognition? A separate flag for
each? Maybe groups (i.e. Memory functions). And so on.

On Thu, Aug 17, 2017 at 7:29 PM Robinson, Paul via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Right, it's a balance between those snooty compiler developers who think
> they always know best versus those pesky real-world code authors who think
> they can hand-tune their code to do better than what the compiler comes up
> with.
>
> Offhand I don't know how often our licensees use the option in production,
> but it surely gives them a tool that lets them do their own measurements,
> and only come back to us when there is something worthwhile to report.
>
> --paulr
>
>
>
> *From:* cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] *On Behalf Of *Reid
> Kleckner via cfe-dev
> *Sent:* Wednesday, August 16, 2017 1:39 PM
> *To:* Tim Northover
> *Cc:* LLVM Developers Mailing List; cfe-dev at lists.llvm.org Developers;
> bharathi seshadri
> *Subject:* Re: [cfe-dev] [llvm-dev] Disable memset synthesis
>
>
>
> On Tue, Aug 15, 2017 at 9:37 PM, Tim Northover via cfe-dev <
> cfe-dev at lists.llvm.org> wrote:
>
> On 15 August 2017 at 19:38, bharathi seshadri via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I find that GCC has an option -fno-tree-loop-distribute-patterns that
> > can be used to disable memcpy/memset synthesis. I wonder if there is
> > something similar in llvm/clang.
>
> I have no idea what that means, but we almost certainly don't have any
> option with similar semantics. Clang does not provide options to
> control specific optimization passes like that.
>
>
>
> I think Sony exposes an option to disable idiom recognition in PS4
> compiler. This seems like one of those areas where users keep asking for
> something and we keep insisting that what they think they want isn't
> actually what they want, i.e. disabling idiom recognition blocks mid-level
> canonicalization and that leads to missing optimizations and bad
> performance, etc. However, the user feedback has been persistent, and in
> the interests of not having to hear about it again, we might want to
> consider giving users the rope they need to hang themselves. It would let
> them work around real performance problems today rather than waiting for
> the next version of the compiler that will lower memset/memcpy/memcmp
> better.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170817/cc7d60b8/attachment.html>


More information about the cfe-dev mailing list