[cfe-dev] Constexpr evaluation speed

Arthur O'Dwyer via cfe-dev cfe-dev at lists.llvm.org
Thu Mar 4 14:34:16 PST 2021


On Thu, Mar 4, 2021 at 3:25 PM David Rector via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> On Mar 4, 2021, at 2:26 PM, Balázs Benics <benicsbalazs at gmail.com> wrote:
>
> I don't think you can easily substitute constexpr evaluation with simply
> calling a compiled counterpart. [...]
>
>
> Thanks for this input, you’re right — e.g. `constexpr void f(A *a)` might
> or might not be able to handle `f(nullptr)`; it would require proof, and
> there things probably get too complex.
>

The other thing you have to keep in mind is cross-compilers. JIT
interpreters do not have to deal with cross-compilation.
Clang could certainly invest in JIT-compiled codepaths for its constexpr
evaluation, and that might make the *usual* desktop-compilation path
blazing fast... but then you'd be in this weird situation where
Boost-or-whatever compiled in a reasonable amount of time for x86-64, but
building an ARM binary would take days. (Until you bought an M1 Mac, I
guess, and then the situation would flip-flop.)

my $.02,
Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20210304/f0aff72c/attachment.html>


More information about the cfe-dev mailing list