U.Mutlu via llvm-dev
2018-Jun-19 19:33 UTC
[llvm-dev] Naming clash: -DCLS=n and CLS in code
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
Bruce Hoult via llvm-dev
2018-Jun-19 19:41 UTC
[llvm-dev] Naming clash: -DCLS=n and CLS in code
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>
U.Mutlu via llvm-dev
2018-Jun-19 21:35 UTC
[llvm-dev] Naming clash: -DCLS=n and CLS in code
Bruce Hoult via llvm-dev wrote on 06/19/2018 09:41 PM:> 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.Yeah, but the problem still would persist. Guess why?... :-)