[Bug tree-optimization/82776] Unable to optimize the loop when iteration count is unavailable.

2024-07-16 Thread ben.maurer at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82776 --- Comment #10 from Ben Maurer --- This appears to be fixed: https://godbolt.org/z/r49nYx6df

[Bug tree-optimization/78103] Failure to optimize with __builtin_clzl

2016-10-24 Thread ben.maurer at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78103 --- Comment #1 from Ben Maurer --- Also along the same lines: https://godbolt.org/g/Nzed5m GCC figures out BSRNew, but there's a cdqe instruction that's unnecessary

[Bug tree-optimization/78103] New: Failure to optimize with __builtin_clzl

2016-10-24 Thread ben.maurer at gmail dot com
-optimization Assignee: unassigned at gcc dot gnu.org Reporter: ben.maurer at gmail dot com Target Milestone: --- constexpr unsigned long findLastSet(unsigned long x) { return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0; } constexpr unsigned long findLastSet2

[Bug libstdc++/59439] std::locale uses atomic instructions on construction

2013-12-10 Thread ben.maurer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439 --- Comment #6 from Ben Maurer --- I agree this isn't necessarily the cleanest way to accomplish this task. My discovery of this bug came through a real life application which was deployed to real users and had a noticeable impact due to this iss

[Bug libstdc++/59439] std::locale uses atomic instructions on construction

2013-12-09 Thread ben.maurer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439 --- Comment #4 from Ben Maurer --- Also, here's where perf says time is being spent. While only 25% is shown as being in the locale constructor/destructor, I suspect that the time spent in other methods is actually related to the ping-ponging of c

[Bug libstdc++/59439] std::locale uses atomic instructions on construction

2013-12-09 Thread ben.maurer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439 --- Comment #3 from Ben Maurer --- Created attachment 31405 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31405&action=edit Benchmark _build/opt/experimental/bmaurer/benchmark snprintf 1 threads took 20 ms 2 threads took 20 ms 3 threads to

[Bug libstdc++/59439] std::locale uses atomic instructions on construction

2013-12-09 Thread ben.maurer at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59439 --- Comment #1 from Ben Maurer --- Facebook is putting a $50 bounty on this bug via bountysource: https://www.bountysource.com/issues/1350875

[Bug libstdc++/59439] New: std::locale uses atomic instructions on construction

2013-12-09 Thread ben.maurer at gmail dot com
Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: ben.maurer at gmail dot com In a large multithreaded program that uses stringstream to stringify integers, I have seen that construction and deconstruction of std::locale can take over 10% of the runtime according