[llvm-dev] Naming clash: -DCLS=n and CLS in code

Bruce Hoult via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 19 12:41:17 PDT 2018


If you're trying to add new functionality, why not do it like

gcc -DLEVEL1_DCACHE_LINESIZE=$(getconf LEVEL1_DCACHE_LINESIZE)

More obvious and much less chance of clashing with something else.

The preprocessor is a very blunt hammer, doesn't know C++, doesn't respect
any kind of scope rules. Avoid potential clashes.


On Tue, Jun 19, 2018 at 12:33 PM, U.Mutlu via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Tim Northover via llvm-dev wrote on 06/19/2018 09:22 PM:
>
>> On Tue, 19 Jun 2018 at 20:12, U.Mutlu <um at mutluit.com> wrote:
>>
>>> You can find more examples by searching for "DCLS getconf
>>> LEVEL1_DCACHE_LINESIZE".
>>>
>>
>> Frankly, it all looks like cargo-cult optimization flagomancy. I'd
>> suggest you drop it, it's not magical I promise.
>>
>
> Hey, I'm working on optimization, and I know "it works".
>
> Curious, have you ever heard of "false sharing" and "true sharing"
> and what lies behind them?
> Hint: it has todo with the cacheline and its size, and memory alignment
> etc...
>
> No need to start a sideline discussion here.
>
> Ciao
>
>
> _______________________________________________
> 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/llvm-dev/attachments/20180619/e01d5492/attachment.html>


More information about the llvm-dev mailing list