|
From: Philippe W. <phi...@sk...> - 2018-06-11 19:14:43
|
I guess that what you mean by 'highest suggested optimization level' is the recommendation to use -O0 or -O1 in the 'quick-start', in the section "2. Preparing your program". In my opinion/in my experience, the advice to use -O1 is obsolete: I routinely use valgrind on -O2 compiled code, without particular problems. And in any case, what -O1/-O2 give for gcc and clang is not the same, and I do not see why they would be the same, and why you would like to obtain comparable speed. Having different speed between gcc and clang compiled code is normal (except maybe for the compiler writers, if they see a huge inefficiency for some code at whatever optimisation level). My advice: just compile your program the way you want, and run valgrind/memcheck on it :). If you want to use valgrind/callgrind, better compile it with the options with which you will deliver your program (so probably with some level of optimisation). Maybe the above does not really answer to your question, but then you should indicate more precisely the problem you want to solve, like: 'I am trying to do .... with valgrind and I obtain the strange behaviour of ...' Philippe On Mon, 2018-06-11 at 11:27 -0400, M. Chaturvedi wrote: > Hi, > > The highest suggested optimization level for Valgrind seems to be `-O1`. What we are seeing is that clang runs much slower with `-O1` than gcc (~3x), even without Valgrind, and with Valgrind, the difference is considerable. To reproduce: > > https://github.com/m-chaturvedi/test_valgrind_slowdown > > I have asked the question of how can I make clang and gcc of comparable speeds on LLVM and gcc mailing lists to no avail. > > I was wondering if folks at Valgrind would have any suggestions about it, perhaps if there are any compiler wise difference in the highest optimization level one could use without affecting the results much? > > GCC: https://gcc.gnu.org/ml/gcc-help/2018-06/msg00023.html > LLVM: http://lists.llvm.org/pipermail/llvm-dev/2018-May/123708.html > > > Thanks, > Mmanu Chaturvedi > > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |