[llvm] [LoopIdiom] Don't introduce `wcslen` calls when `wchar` size is not the default (PR #213629)
Ömer Sinan Ağacan via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 3 02:36:16 PDT 2026
osa1 wrote:
Thinking about this more, I wonder if there's even an issue to be fixed here. Regardless of whether you use `-fshort-wchar` or not you need to make sure all your compilation units and runtime libraries assume the same `wchar` size. If you override it in some of the linked files and not others, it's a problem. Making the loop recognizer not introduce `wchar` passing/returning calls makes this a bit less likely to be a problem maybe but it can't fix it. You also lose optimization opportunities when you override it everywhere the same way (i.e. when `wcslen` is also compiled with `-fshort-wchar`).
@mustartt @efriedma-quic any thoughts?
https://github.com/llvm/llvm-project/pull/213629
More information about the llvm-commits
mailing list