<div dir="ltr">I'm prepared to give the benefit of the doubt and assume there's a "#ifndef #define ..." somewhere, not shown for brevity.<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 19, 2018 at 12:49 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, 19 Jun 2018 at 20:46, Bruce Hoult <<a href="mailto:brucehoult@sifive.com">brucehoult@sifive.com</a>> wrote:<br>
> Furthermore .. in the articles you reference, the -DCLS=$(getconf LEVEL1_DCACHE_LINESIZE) is passed when compiling the user's program -- one doing extensive blocked matrix operations -- and not when building the *compiler*.<br>
<br>
</span>It's worse. At least in the first case, the code looks like it<br>
wouldn't even compile without that definition. That's not an<br>
optimization flag, that's a weird build system.<br>
<div class="HOEnZb"><div class="h5">><br>
><br>
> On Tue, Jun 19, 2018 at 12:12 PM, U.Mutlu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> Tim Northover wrote on 06/19/2018 08:54 PM:<br>
>>>>><br>
>>>>> Why are you passing that argument in the first place? The compiler<br>
>>>>> completely ignores it.<br>
>>>><br>
>>>><br>
>>>> CLS stands for cacheline size. It is an important parameter<br>
>>>> for optimization of the generated code, at least with gcc/g++.<br>
>>>> -DCLS=n should have the same importance like for example -DNDEBUG.<br>
>>><br>
>>><br>
>>> The GCC source doesn't appear to mention it, and neither does any<br>
>>> documentation I can find. NDEBUG on the other hand is in both the C<br>
>>> and C++ standards.<br>
>>><br>
>>> I still think there's some weird library out there that interprets it<br>
>>> the way you're suggesting, and Clang is not that weird library.<br>
>><br>
>><br>
>> This is from a famous article series titled "What every programmer should know about memory":<br>
>>   gcc -DCLS=$(getconf LEVEL1_DCACHE_LINESIZE) ...<br>
>><br>
>> <a href="https://lwn.net/Articles/255364/" rel="noreferrer" target="_blank">https://lwn.net/Articles/<wbr>255364/</a><br>
>> <a href="http://mosermichael.github.io/cstuff/all/blog/2015/12/11/wepskn.html" rel="noreferrer" target="_blank">http://mosermichael.github.io/<wbr>cstuff/all/blog/2015/12/11/<wbr>wepskn.html</a><br>
>> <a href="https://www.dcl.hpi.uni-potsdam.de/teaching/numasem/slides/NUMASem_Matrix_multiplication.pdf" rel="noreferrer" target="_blank">https://www.dcl.hpi.uni-<wbr>potsdam.de/teaching/numasem/<wbr>slides/NUMASem_Matrix_<wbr>multiplication.pdf</a><br>
>><br>
>> You can find more examples by searching for "DCLS getconf LEVEL1_DCACHE_LINESIZE".<br>
>><br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> LLVM Developers mailing list<br>
>> <a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>