[ConstantFolding] Non-constrained functions in strictfp
Non-constrained function calls, allowed in strictfp functions by
PR188297, are equivalent to their constrained counterparts with dynamic
rounding and strict exception handling. When constant folding the calls
of these functions, some cases cannot be folded due to unknown rounding
mode or floting-point exceptions that can be lost. This change adapts
constant folding for these case.
[ConstantFolding] Non-constrained functions in strictfp
Non-constrained function calls, allowed in strictfp functions by
PR188297, are equivalent to their constrained counterparts with dynamic
rounding and strict exception handling. When constant folding the calls
of these functions, some cases cannot be folded due to unknown rounding
mode or floting-point exceptions that can be lost. This change adapts
constant folding for these case.
[IR] Use iteration limit in stripPointerCastsAndOffsets (#190472)
Using a SmallPtrSet is not quite free for such a frequently called
operation. However, calls on ill-formed IR are not particularly rare, so
some iteration limit is needed. Therefore, use a simple counter.
Termination statistics on a Clang Release build for N>5:
2448 N=6
1295 N=7
480 N=8
294 N=9
160 N=10
14350 (endless loop)
Therefore, bound the number of iterations by 12, which should cover most
practically relevant cases.
It is worth noting that _all_ of the endless loop cases have the
[5 lines not shown]