[libcxx-commits] [libcxx] [libc++] Add basic constant folding for std::format (PR #107197)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Sep 12 10:00:53 PDT 2024


https://github.com/ldionne commented:

At first glance I think this makes sense. I'm unsure how much this is actually buying us cause this pattern might be really really infrequent. However as @philnik777 pointed out just now this might be common when `format` is used through `std::print`.

One general thing I'd like to mention is that we should be mindful of making our implementations more heavyweight for these kinds of optimizations. I think they are great and most of the time worth it, but we should keep in mind that we're adding more dependencies and more "code" for the compiler to churn through. Not a problem with this patch, but we should keep this in our heads as we work on these optimizations to make sure we don't lose sight of the big picture.

https://github.com/llvm/llvm-project/pull/107197


More information about the libcxx-commits mailing list