* An interesting "optimization"? for __glibcxx_assert under verbose mode
@ 2021-10-15 0:30 unlvsur unlvsur
2021-10-15 0:40 ` unlvsur unlvsur
0 siblings, 1 reply; 2+ messages in thread
From: unlvsur unlvsur @ 2021-10-15 0:30 UTC (permalink / raw)
To: unlvsur unlvsur via Libstdc++
I think the parameter can be just embedded in the symbol name of the function. This improves code gen and make optimizers happier under -Os.
But it only works under C++20.
This is a proven concept. It works for both gcc and clang
https://godbolt.org/z/s35s8MTac
https://godbolt.org/z/5KK5PzMEj
Os:
https://godbolt.org/z/4MjGdTajf
https://godbolt.org/z/crfWf41vc
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
^ permalink raw reply [flat|nested] 2+ messages in thread
* RE: An interesting "optimization"? for __glibcxx_assert under verbose mode
2021-10-15 0:30 An interesting "optimization"? for __glibcxx_assert under verbose mode unlvsur unlvsur
@ 2021-10-15 0:40 ` unlvsur unlvsur
0 siblings, 0 replies; 2+ messages in thread
From: unlvsur unlvsur @ 2021-10-15 0:40 UTC (permalink / raw)
To: unlvsur unlvsur via Libstdc++, unlvsur unlvsur via Libstdc++
This is a better example that can show the benefit
https://godbolt.org/z/aPo95Eb3P
https://godbolt.org/z/Wd4nev8eh
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
From: unlvsur unlvsur<mailto:unlvsur@live.com>
Sent: Thursday, October 14, 2021 20:30
To: unlvsur unlvsur via Libstdc++<mailto:libstdc++@gcc.gnu.org>
Subject: An interesting "optimization"? for __glibcxx_assert under verbose mode
I think the parameter can be just embedded in the symbol name of the function. This improves code gen and make optimizers happier under -Os.
But it only works under C++20.
This is a proven concept. It works for both gcc and clang
https://godbolt.org/z/s35s8MTac
https://godbolt.org/z/5KK5PzMEj
Os:
https://godbolt.org/z/4MjGdTajf
https://godbolt.org/z/crfWf41vc
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-15 0:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 0:30 An interesting "optimization"? for __glibcxx_assert under verbose mode unlvsur unlvsur
2021-10-15 0:40 ` unlvsur unlvsur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).