[llvm-commits] [llvm] r169049 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Owen Anderson resistor at mac.com
Sat Dec 1 13:38:36 PST 2012


On Dec 1, 2012, at 5:13 AM, Duncan Sands <baldrick at free.fr> wrote:

> it would be great to have a library that evaluates constant expressions
> like log2(something) perfectly, rather than having to do this dance around
> whether the host evaluates functions accurately enough.  I think GCC uses
> MPFR for this.  In the meantime I suppose we are obliged, as you say, to
> restrict to cases we can evaluate exactly.

There's an interesting question in there about whether one should implement "perfect" evaluation, or should try to match the semantics of the target.  I've heard of some vendor compilers that went so far as it embed a simulator for the target platform which they used to do truly accurate target-platform-accurate constant folding.

--Owen



More information about the llvm-commits mailing list