Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Issue 1808503003: Add graph intrinsics for math library functions (Closed)

Created:
4 years, 9 months ago by Cutch
Modified:
4 years, 9 months ago
Reviewers:
Florian Schneider
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Add graph intrinsics for many math library functions - sin, cos, tan, asin, acos, atan, and atan2. R=fschneider@google.com Committed: https://github.com/dart-lang/sdk/commit/7dc6bdefa3f0c0078933a3c1ea80fb8c4c3696d1

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -11 lines) Patch
M runtime/vm/intermediate_language.cc View 1 2 chunks +6 lines, -0 lines 0 comments Download
M runtime/vm/intrinsifier.cc View 1 2 9 chunks +201 lines, -4 lines 0 comments Download
M runtime/vm/method_recognizer.h View 1 2 3 chunks +9 lines, -7 lines 0 comments Download

Messages

Total messages: 15 (4 generated)
Cutch
PTAL before I do more intrinsics.
4 years, 9 months ago (2016-03-15 22:17:05 UTC) #3
Florian Schneider
https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc File runtime/vm/intrinsifier.cc (right): https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc#newcode307 runtime/vm/intrinsifier.cc:307: AddInstruction(new CheckClassInstr(new Value(boxed), Since these math functions call toDouble ...
4 years, 9 months ago (2016-03-16 15:51:49 UTC) #4
Cutch
https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc File runtime/vm/intrinsifier.cc (right): https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc#newcode307 runtime/vm/intrinsifier.cc:307: AddInstruction(new CheckClassInstr(new Value(boxed), On 2016/03/16 15:51:49, Florian Schneider wrote: ...
4 years, 9 months ago (2016-03-16 19:35:56 UTC) #5
Cutch
PTAL
4 years, 9 months ago (2016-03-16 20:10:37 UTC) #7
Cutch
On 2016/03/16 20:10:37, Cutch wrote: > PTAL PTAL
4 years, 9 months ago (2016-03-17 22:18:56 UTC) #8
Florian Schneider
The only comment is about using UnboxInstr only, and avoiding the CheckClass. Otherwise lgtm. https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc ...
4 years, 9 months ago (2016-03-19 09:40:56 UTC) #9
Florian Schneider
One more general comment: The graph intrinsics allow a quick way to avoid the overhead ...
4 years, 9 months ago (2016-03-21 16:40:15 UTC) #10
Cutch
https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc File runtime/vm/intrinsifier.cc (right): https://codereview.chromium.org/1808503003/diff/1/runtime/vm/intrinsifier.cc#newcode307 runtime/vm/intrinsifier.cc:307: AddInstruction(new CheckClassInstr(new Value(boxed), On 2016/03/19 09:40:56, Florian Schneider wrote: ...
4 years, 9 months ago (2016-03-21 17:03:48 UTC) #11
Cutch
Committed patchset #3 (id:40001) manually as 7dc6bdefa3f0c0078933a3c1ea80fb8c4c3696d1 (presubmit successful).
4 years, 9 months ago (2016-03-21 17:23:55 UTC) #13
Cutch
Florian, The CheckClass instr you had me remove ended up causing many test failures on ...
4 years, 9 months ago (2016-03-21 19:46:21 UTC) #14
Florian Schneider
4 years, 9 months ago (2016-03-22 08:56:28 UTC) #15
Message was sent while issue was closed.
On 2016/03/21 19:46:21, Cutch wrote:
> Florian,
> 
> The CheckClass instr you had me remove ended up causing many test failures on
> the bots[1]. As I explained previously, the call to '.toDouble()' occurs
*after*
> the intrinsic executes and not before. Inserting the CheckClass instruction as
> in my original CL results in all tests passing.
> 
> I've re-uploaded my CL here: https://codereview.chromium.org/1821783002
> 
> [1]
>
https://build.chromium.org/p/client.dart/builders/vm-mac-debug-x64-be/builds/...

No, we intrinsify atan2 (and not the native _atan2) - the toDouble occurs in the
slow-path. The reason for the failures is that AddUnboxInstr assumes that the
input is checked: It sets the reaching type of the input operand to kDoubleCid.
As a result, there is not class check emitted as part of the UnboxInstr.

Your solution works by adding the explicit CheckClass before, but does not
handle the smi-conversion case.

I think the best solution would be to add a UnboxInstr where the input value has
unknown compile-type.

Powered by Google App Engine
This is Rietveld 408576698