Page MenuHomePhabricator
Feed Advanced Search

Mar 15 2016

scanon added inline comments to D18161: APFloat: Add frexp.
Mar 15 2016, 11:54 AM

Mar 12 2016

scanon accepted D18118: APFloat: Fix ilogb for denormals.

Thanks.

Mar 12 2016, 8:47 PM
scanon accepted D18117: APFloat: Fix scalbn handling of denormals.

LGTM, thanks.

Mar 12 2016, 8:46 PM
scanon added inline comments to D18118: APFloat: Fix ilogb for denormals.
Mar 12 2016, 4:48 AM
scanon added inline comments to D18117: APFloat: Fix scalbn handling of denormals.
Mar 12 2016, 4:37 AM

Jan 29 2016

scanon accepted D16696: InstCombine: fabs(x) * fabs(x) -> x * x.

The signbit of NaN explicitly has no meaning, so there's no concern there. LGTM.

Jan 29 2016, 2:31 PM

Jan 11 2016

scanon accepted D15937: [LibCallSimplifier] use instruction-level fast-math-flags to transform sqrt calls.

LGTM.

Jan 11 2016, 11:32 AM

Dec 4 2015

scanon accepted D14066: [FPEnv Core 01/14] Add flags and command-line switches for FPEnv.

LGTM.

Dec 4 2015, 12:12 PM
scanon added a comment to D14067: [FPEnv Core 02/14] Add FPEnv access flags to fast-math flags.

Thanks!

Dec 4 2015, 12:02 PM

Dec 2 2015

scanon abandoned D14891: Replace assert with early-out in tryEmitFMulAdd.

Abandoned for D15165.

Dec 2 2015, 5:17 PM
scanon added a comment to D15165: change an assert when generating fmuladd to an ordinary 'if' check (PR25719).

LGTM.

Dec 2 2015, 5:17 PM
scanon added a comment to D15165: change an assert when generating fmuladd to an ordinary 'if' check (PR25719).

This is mostly http://reviews.llvm.org/D14891 with a test case added, but D14891 also fixed a second very minor issue: that the "else if" should just be "if". Also, majnemer made a few style suggestions there that it would be nice to adopt. Either way, we should merge the two patches. This can be the canonical one if you want to update it.

Dec 2 2015, 4:11 PM

Nov 30 2015

scanon added a comment to D14909: [X86][FMA] Optimize FNEG(FMUL) Patterns.
Nov 30 2015, 12:06 PM
scanon added a comment to D14909: [X86][FMA] Optimize FNEG(FMUL) Patterns.

Can we assume default rounding for now, change the operand to X86::FNMSUB, remove the nsz check, and leave a 'TODO' comment to revisit this after rounding mode support is added? I think it would be better to have this transform be more general if we can.

Nov 30 2015, 11:31 AM
scanon added a comment to D14909: [X86][FMA] Optimize FNEG(FMUL) Patterns.

As updated, this seems fine to me.

Nov 30 2015, 10:27 AM

Nov 28 2015

scanon added a comment to D14909: [X86][FMA] Optimize FNEG(FMUL) Patterns.

Could this be resolved by using -0 as the constant instead of 0 in non-fast-math mode?

Nov 28 2015, 5:57 PM
scanon added a comment to D14067: [FPEnv Core 02/14] Add FPEnv access flags to fast-math flags.

Something that also probably needs to be thought about is what will be the default behavior for clang and how to control it?

Nov 28 2015, 5:57 PM
scanon added a comment to D14891: Replace assert with early-out in tryEmitFMulAdd.

Friendly ping.

Nov 28 2015, 2:53 PM
scanon added inline comments to D14909: [X86][FMA] Optimize FNEG(FMUL) Patterns.
Nov 28 2015, 2:52 PM

Nov 20 2015

scanon retitled D14891: Replace assert with early-out in tryEmitFMulAdd from to Replace assert with early-out in tryEmitFMulAdd.
Nov 20 2015, 3:49 PM

Nov 18 2015

scanon added a comment to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.

As long as we're really going to dig into the addition-chain issue, why are we duplicating Reassociate::buildMinimalMultiplyDAG here?

Nov 18 2015, 7:59 AM

Nov 17 2015

scanon added a comment to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.

This looks good to me now. One of the owners should probably sign off on it too.

Nov 17 2015, 6:34 PM
scanon added a comment to D14466: [SimplifyLibCalls] pow(x, 0.5) -> sqrt(x) in fast-math mode.

LGTM

Nov 17 2015, 1:58 PM
scanon added a comment to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.

Hence the "something like". We should really just be able to pull and integer value out of APFloat (but again, outside the scope of this change). Short-term, I think you can use V.convert(APFloat::IEEEdouble, ...) to get something that *can* be converted to double.

Nov 17 2015, 4:52 AM

Nov 16 2015

scanon added inline comments to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.
Nov 16 2015, 5:57 PM
scanon committed rL253269: Make FP_CONTRACT ON the default..
Make FP_CONTRACT ON the default.
Nov 16 2015, 3:12 PM
scanon closed D14200: Make FP_CONTRACT ON default. by committing rL253269: Make FP_CONTRACT ON the default..
Nov 16 2015, 3:12 PM
scanon added a comment to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.

I went ahead and added isInteger( ) to APFloat (r253254). You can use that to simplify some of the logic and make it somewhat more general.

Nov 16 2015, 1:59 PM
scanon committed rL253254: Add isInteger() to APFloat..
Add isInteger() to APFloat.
Nov 16 2015, 1:55 PM
scanon added inline comments to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.
Nov 16 2015, 12:27 PM

Nov 5 2015

scanon added a comment to D14400: [SimplifyLibCalls] Tranform log(pow(x, y)) -> y*log(x).

The one thing that's a little bit weird here is cases like x = -1, y = 4; log(pow(-1, 4)) is 0, but 4*log(-1) is NaN. That's a dramatic difference even for fast-math. Do we find exact integer exponents before we get to this point?

Nov 5 2015, 3:48 PM
scanon added a comment to D14400: [SimplifyLibCalls] Tranform log(pow(x, y)) -> y*log(x).

Seems reasonable from a mathematical perspective.

Nov 5 2015, 3:44 PM

Nov 4 2015

scanon updated the diff for D14200: Make FP_CONTRACT ON default..

Additionally test contraction of compound assignment expressions.

Nov 4 2015, 7:50 AM
scanon committed rL252050: Allow compound assignment expressions to be contracted when licensed by the….
Allow compound assignment expressions to be contracted when licensed by the…
Nov 4 2015, 7:28 AM

Nov 3 2015

scanon added a comment to D14302: [SimplifyLibCalls] Add a new transform: tan(atan(x)) -> x.

I'd like to see this made generic so it applies to any 1-to-1 libm function whose inverse is available, since the same pattern applies for logN(expN(x)), asinh(sinh(x)), atanh(tanh(x)), etc ...

Nov 3 2015, 1:36 PM

Oct 30 2015

scanon updated subscribers of D14200: Make FP_CONTRACT ON default..
Oct 30 2015, 12:40 PM
scanon added a comment to D14045: [SimplifyLibCalls] Add a new transform: pow(exp(x), y) -> exp(x*y).

Seems reasonable to me. One of the owners should sign off on it.

Oct 30 2015, 11:03 AM
scanon added inline comments to D13994: [SimplifyLibCalls] Optimization for pow(x, n) where n is some constant.
Oct 30 2015, 6:53 AM
scanon retitled D14200: Make FP_CONTRACT ON default. from to Make FP_CONTRACT ON default..
Oct 30 2015, 6:45 AM

Oct 26 2015

scanon added a comment to D14067: [FPEnv Core 02/14] Add FPEnv access flags to fast-math flags.

I'd like to propose a mildly different design; I'd phrase the two flags using a positive perspective:

  • nexc: Assume that floating-point exceptions are not relevant.
  • nrnd: Assume that the rounding-mode is round-to-nearest (ties even).

    This has the nice property that fast is the union of all flags and, in general, keeps things consistent with all the other fast math flags. The general pattern is that adding flags permits further optimization; places where this is violated have been a wellspring of bugs (namely volatile).
Oct 26 2015, 8:59 AM
scanon added inline comments to D14069: [FPEnv Core 04/14] Skip constant folding to preserve FPEnv.
Oct 26 2015, 8:29 AM
scanon added inline comments to D14067: [FPEnv Core 02/14] Add FPEnv access flags to fast-math flags.
Oct 26 2015, 8:12 AM
scanon added inline comments to D14066: [FPEnv Core 01/14] Add flags and command-line switches for FPEnv.
Oct 26 2015, 8:06 AM
scanon added a comment to D14045: [SimplifyLibCalls] Add a new transform: pow(exp(x), y) -> exp(x*y).

As suggested by David, this should be fast-math only. It's roughly equivalent to re-association of multiplication. Besides rounding differences, this changes overflow and underflow behavior quite dramatically. Consider x = 1000, y = 0.001. pow(exp(x), y) = pow(inf, 0.001) = inf, whereas exp(x*y) = exp(1).

Oct 26 2015, 7:28 AM

Sep 25 2015

scanon added inline comments to D12635: merge vector stores into wider vector stores and fix AArch64 misaligned access TLI hook (PR21711).
Sep 25 2015, 1:13 PM
scanon added inline comments to D12635: merge vector stores into wider vector stores and fix AArch64 misaligned access TLI hook (PR21711).
Sep 25 2015, 1:01 PM
scanon updated subscribers of D12635: merge vector stores into wider vector stores and fix AArch64 misaligned access TLI hook (PR21711).
Sep 25 2015, 10:45 AM

Sep 23 2015

scanon updated subscribers of D12793: Three new overflow builtins with generic argument types.
Sep 23 2015, 1:06 PM

Sep 22 2015

scanon committed rL248266: Don't raise inexact when lowering ceil, floor, round, trunc..
Don't raise inexact when lowering ceil, floor, round, trunc.
Sep 22 2015, 4:45 AM
scanon closed D12969: Don't raise inexact when lowering ceil, floor, round, trunc by committing rL248266: Don't raise inexact when lowering ceil, floor, round, trunc..
Sep 22 2015, 4:45 AM

Sep 21 2015

scanon committed rL248195: Remove roundingMode argument in APFloat::mod.
Remove roundingMode argument in APFloat::mod
Sep 21 2015, 12:31 PM
scanon added a comment to D12969: Don't raise inexact when lowering ceil, floor, round, trunc.

Sorry for only bringing this up now, but this doesn't look right. I think if an FRINTX does get created it probably should be treated specially. You'd mostly only do so (by calling "rint") if you actually cared about the otherwise unmodeled FPSR flags, wouldn't you?

Sep 21 2015, 10:45 AM
scanon updated the diff for D12969: Don't raise inexact when lowering ceil, floor, round, trunc.

Removed AArch64DAGToDAGISel::SelectFPConvertWithRound() and SelectLIBM() in favor of TD patterns.

Sep 21 2015, 10:24 AM

Sep 18 2015

scanon retitled D12969: Don't raise inexact when lowering ceil, floor, round, trunc from to Don't raise inexact when lowering ceil, floor, round, trunc.
Sep 18 2015, 9:39 AM

Sep 15 2015

scanon accepted D11210: Broaden optimization of fcmp ([us]itofp x, constant).

Looks good to me. Apologies for delay in getting to this one.

Sep 15 2015, 7:10 AM

Sep 14 2015

scanon committed rL247643: Prevent implicit re-interpret casts between ExtVector and Scalar types..
Prevent implicit re-interpret casts between ExtVector and Scalar types.
Sep 14 2015, 5:23 PM

Jun 22 2015

scanon accepted D10594: Fix incorrect truncation at the overflow boundary.

LGTM.

Jun 22 2015, 5:41 PM

May 12 2015

scanon added a comment to D9693: [Builtins] Implement half-precision conversions..

Looks reasonable to me. Someone else will need to answer your question about gnu_*_ieee aliases.

May 12 2015, 3:03 AM

Mar 9 2015

scanon added a comment to D6942: Clarified the direction rounding occurs in uitofp and sitofp is unspecified.

I'm uncomfortable with this change, as I believe that it makes the llvm conversions incompatible with IEEE-754 conversion (which round according to the dynamic rounding mode unless they're in a (language defined) block with static rounding attribute).

Mar 9 2015, 6:14 AM
scanon accepted D2804: [COMPILER-RT] Implement __fixtfsi, __fixunstfsi.

Thanks for keeping after this. Looks good to me.

Mar 9 2015, 6:08 AM

Dec 4 2014

scanon added a comment to D6526: [X86][SSE] Keep 4i32 vector insertions in integer domain on pre-SSE4.1 targets.

I'm rather dubious of this. Do you have timing info to support this?

Dec 4 2014, 12:24 PM

Oct 17 2014

scanon added a comment to D5756: [complex] Teach the complex math IR gen to emit direct math and a NaN-test prior to the call to the library function..

Apologies for delay in looking at this, I'm on vacation this week.

Oct 17 2014, 2:23 AM

Oct 9 2014

scanon accepted D5698: [complex] Teach Clang to preserve different-type operands to arithmetic operators where one type is a C complex type, and to emit both the efficient and correct implementation for complex arithmetic according to C11 Annex G using this extra....

Thanks for working on this, Chandler, it’s an enormous improvement over the current state of affairs.

Oct 9 2014, 8:44 AM

Sep 17 2014

scanon added a comment to D2804: [COMPILER-RT] Implement __fixtfsi, __fixunstfsi.

I think it makes sense to clamp out-of-range values. Even though the C language cast is UB, there’s a fairly clear “right” thing to do, and we can do it without excessive performance penalty. Let’s follow libgcc here and saturate.

Sep 17 2014, 5:48 PM

Jun 10 2014

scanon added a comment to D3909: Support building floating-point facilities on FreeBSD 9.2 in 32-bit mode.

LGTM. I'm no expert on the BSD environment, but this seems perfectly reasonable.

Jun 10 2014, 9:34 AM