scanon (Steve Canon)
User

Projects

User does not belong to any projects.

User Details

User Since
Jun 10 2014, 9:32 AM (171 w, 3 d)

Recent Activity

Wed, Sep 13

scanon accepted D34695: _Float16 preprocessor macro definitions.

LGTM as well.

Wed, Sep 13, 8:18 AM

Tue, Sep 12

scanon added inline comments to D34695: _Float16 preprocessor macro definitions.
Tue, Sep 12, 8:59 AM
scanon added inline comments to D34695: _Float16 preprocessor macro definitions.
Tue, Sep 12, 8:36 AM

Wed, Sep 6

scanon accepted D35222: InstSimplify: canonicalize is idempotent.

LGTM. Sorry that I didn't see this earlier.

Wed, Sep 6, 8:30 AM

Aug 21 2017

scanon requested changes to D36961: [APFloat] Fix IsInteger() for DoubleAPFloat.

... except, please add another test-case where the other component is not an integer as well.

Aug 21 2017, 9:37 AM
scanon accepted D36961: [APFloat] Fix IsInteger() for DoubleAPFloat.

This looks fine.

Aug 21 2017, 9:35 AM

Aug 4 2017

scanon added a comment to D28335: [WIP] [RFC] Don't lower floating point intrinsics to libcalls which modify errno.

Huh, I guess we do use the x87 sin/cos. It's probably a terrible idea (the microcoded routines are both slow and wildly inaccurate for large inputs), but we do it.

Aug 4 2017, 4:08 PM

Mar 31 2017

scanon committed rL299257: Fix 80-column violation in previous commit..
Fix 80-column violation in previous commit.
Mar 31 2017, 1:47 PM
scanon committed rL299256: Fix APFloat mod (committing for simonbyrne).
Fix APFloat mod (committing for simonbyrne)
Mar 31 2017, 1:44 PM
scanon closed D29346: Fix APFloat mod by committing rL299256: Fix APFloat mod (committing for simonbyrne).
Mar 31 2017, 1:44 PM
scanon added a comment to D31533: Do not translate rint into nearbyint, but truncate it like nearbyint.

If rint() is faster than nearbyint(), should we canonicalize nearbyint()->rint()?

Mar 31 2017, 11:34 AM
scanon added a reviewer for D31398: [X86][X86 intrinsics]Folding cmp(sub(a,b),0) into cmp(a,b) optimization: hfinkel.

(x-y) == 0 --> x == y does not require nsz (zeros of any sign compare equal), nor does it require nnan (if x or y is NaN, both comparisons are false). It *does* require ninf (because inf-inf = NaN), and it also requires that subnormals are not flushed by the CPU. There's been some churn around flushing recently, Hal may have thoughts (+Hal).

Mar 31 2017, 7:44 AM
scanon accepted D31533: Do not translate rint into nearbyint, but truncate it like nearbyint.

LGTM.

Mar 31 2017, 6:56 AM
scanon added a comment to D31182: [InstCombine] fadd double (sitofp x), y check that the promotion is valid .

This addresses my concerns. Gentle ping to the other reviewers.

Mar 31 2017, 6:55 AM

Mar 21 2017

scanon added inline comments to D31164: [IR] Add AllowContract to FastMathFlags.
Mar 21 2017, 9:42 AM
scanon added inline comments to D31182: [InstCombine] fadd double (sitofp x), y check that the promotion is valid .
Mar 21 2017, 9:38 AM
scanon added a comment to D31182: [InstCombine] fadd double (sitofp x), y check that the promotion is valid .

The assumption is that an integer add is more canonical and/or cheaper than an FP add. Is that universally true?

Mar 21 2017, 9:31 AM

Mar 8 2017

scanon added a comment to D30527: Replacing float with new class Fraction for LSR alternative way of resolving complex solution.

What's the rationale for using rationals here instead of a (simpler) fixed-point representation, if we want to get rid of float?

Mar 8 2017, 8:35 AM

Feb 7 2017

scanon added a comment to D29346: Fix APFloat mod.

Great, thanks Simon! This looks fine numerically. @gottesmm, can you double-check for style, etc?

Feb 7 2017, 9:49 AM

Feb 1 2017

scanon added a comment to D29346: Fix APFloat mod.

Numerically this is sound, and something that I've wanted to fix for a while but haven't had time to deal with. Thanks for doing it! Please add some test cases that would detect the old error (@gottesmm can likely point you in the right direction).

Feb 1 2017, 5:58 AM

Jan 19 2017

scanon added a comment to D28862: [compiler-rt] [test] Use approximate comparison on float types.

These tests should either be exact, or should have a tolerance that's mathematically sound. +/-1ulp is not sound; the allowed error should be proportional to the magnitude of the larger of the real and imaginary components of the result -- e.g. if one component is very small compared to the other, the smaller one may have *no* "correct" bits and still be acceptable.

Jan 19 2017, 7:01 AM

Jan 6 2017

scanon accepted D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().

OK, I'm satisfied with that.

Jan 6 2017, 10:00 AM
scanon added inline comments to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().
Jan 6 2017, 7:54 AM

Jan 4 2017

scanon added inline comments to D27932: InstSimplify: Eliminate fabs on known positive.
Jan 4 2017, 11:28 AM
scanon added inline comments to D27028: Add intrinsics for constrained floating point operations.
Jan 4 2017, 9:32 AM
scanon added inline comments to D27932: InstSimplify: Eliminate fabs on known positive.
Jan 4 2017, 9:28 AM

Dec 23 2016

scanon requested changes to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().

I don't particularly care about the shift, since the code is completely equivalent either way, though it would be nice to clean up. However, please replace "mantissa" with "significand" before committing.

Dec 23 2016, 4:54 AM
scanon added inline comments to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().
Dec 23 2016, 4:51 AM

Dec 22 2016

scanon added inline comments to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().
Dec 22 2016, 10:41 AM
scanon added inline comments to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().
Dec 22 2016, 10:36 AM
scanon added a comment to D27898: [compiler-rt] [builtins] Implement __floattitf() & __floatuntitf().

Please s/mantissa/significand/. I know that "mantissa" is used in a number of places in llvm sources, but it's incorrect terminology. Significand is the IEEE-754 nomenclature, which any new work should follow.

Dec 22 2016, 10:20 AM

Sep 26 2016

scanon added a comment to D24925: [testsuite] turn fp-contract off because we can check those results more precisely.

The tests in question are broken. They blindly apply a relative error tolerance that is not motivated by sound numerical analysis, despite the existence of well-known and well-founded error bounds for these problems, in every basic numerical analysis textbook.

Sep 26 2016, 10:56 AM

Sep 22 2016

scanon accepted D24481: make “#pragma STDC FP_CONTRACT” on by default.

LGTM

Sep 22 2016, 10:44 AM

Sep 12 2016

scanon added a comment to D24481: make “#pragma STDC FP_CONTRACT” on by default.

Abe, I had a patch to do the same thing last year (that we ended up backing out because it exposed a bug which has since been fixed). Your approach looks a bit different from the one that I took originally, and you seem to be missing some of the arm64 test changes that I had to put in:

Sep 12 2016, 4:40 PM
scanon added a reviewer for D24481: make “#pragma STDC FP_CONTRACT” on by default: hfinkel.
Sep 12 2016, 4:37 PM

Jul 15 2016

scanon added a comment to D18639: Use __builtin_isnan/isinf/isfinite in complex.

I am not the right person to review the C++ template details, but everything else seems OK to me.

Jul 15 2016, 8:02 AM

Jul 1 2016

scanon added a comment to D18639: Use __builtin_isnan/isinf/isfinite in complex.

I agree with Marshall. Aside from the points he raises, this approach looks fine.

Jul 1 2016, 8:49 AM

May 26 2016

scanon added a comment to D19391: transform obscured FP sign bit ops into a fabs/fneg using TLI hook.

Numerically, I'm fine with this. Someone else can address the approach and style, etc.

May 26 2016, 9:20 AM

May 23 2016

scanon added inline comments to D19178: Broaden FoldItoFPtoI to try and establish whether the integer value fits into the float type.
May 23 2016, 7:38 AM

May 17 2016

scanon added a comment to D20341: [CUDA] Enable fusing FP ops for CUDA by default..

-ffp-contract=on obeys the semantics of C's FP_CONTRACT pragma. In particular, it will not fuse:

float m = x*y;
float a = m + z;

Whereas you probably want that to fuse for your purposes. -ffp-contract=fast seems more in line with your needs.

May 17 2016, 4:29 PM

May 12 2016

scanon added inline comments to D19178: Broaden FoldItoFPtoI to try and establish whether the integer value fits into the float type.
May 12 2016, 8:33 AM

Apr 8 2016

scanon added a comment to D18874: InstCombine optimization to convert floating-point sign bit XORs to fsubs from -0.0.

The input code is denorm preserving on architectures that flush denorms, but the output may not be.

Apr 8 2016, 10:41 AM
scanon added a comment to D18874: InstCombine optimization to convert floating-point sign bit XORs to fsubs from -0.0.

There are a few niche floating-point formats that use a representation of the form [ exponent | 2s complement significand ], so the signbit ends up sitting in the middle of the number. Does LLVM claim to support arbitrary oddball formats for float/double? Ideally we would specify that LLVM assumes IEEE formats, even if we don't require fully conformant operations in hardware; that would give us some flexibility.

Apr 8 2016, 9:53 AM

Apr 7 2016

scanon added a comment to D18513: Simplify isfinite/isnan/isinf in finite-math-only mode.

Breaking isnan, isinf, etc is a non-starter. I know it's appealing from a consistent formal model viewpoint, but in practice it breaks a lot of code (this is why we have the call fallbacks for iOS/OSX).

Apr 7 2016, 10:58 AM

Mar 22 2016

scanon accepted D18320: APFloat: Fix signalling nans for scalbn.

OK. Let's take this in as is, then, and someone can look at normalize( ) when they have time.

Mar 22 2016, 10:19 AM

Mar 21 2016

scanon added a reviewer for D18320: APFloat: Fix signalling nans for scalbn: gottesmm.
Mar 21 2016, 10:04 AM
scanon added inline comments to D18320: APFloat: Fix signalling nans for scalbn.
Mar 21 2016, 10:03 AM
scanon accepted D18161: APFloat: Add frexp.

LGTM, thanks.

Mar 21 2016, 9:24 AM

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