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

Issue 10174040: Better constant fold identity checks. (100 bytes saved on swarm, yeah! :)) (Closed)

Created:
8 years, 8 months ago by ngeoffray
Modified:
8 years, 8 months ago
CC:
reviews_dartlang.org, kasperl, karlklose, ahe
Visibility:
Public.

Description

Better constant fold identity checks. (100 bytes saved on swarm, yeah! :)) Committed: https://code.google.com/p/dart/source/detail?r=6999

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+88 lines, -8 lines) Patch
A frog/tests/leg_only/src/ConstantFoldNumberDart2JSTest.dart View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 3 2 chunks +57 lines, -6 lines 0 comments Download
A tests/language/src/ConstantFoldEqualsTest.dart View 1 2 3 1 chunk +15 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
ngeoffray
8 years, 8 months ago (2012-04-26 07:14:41 UTC) #1
Lasse Reichstein Nielsen
LGTM https://chromiumcodereview.appspot.com/10174040/diff/1/lib/compiler/implementation/ssa/nodes.dart File lib/compiler/implementation/ssa/nodes.dart (right): https://chromiumcodereview.appspot.com/10174040/diff/1/lib/compiler/implementation/ssa/nodes.dart#newcode877 lib/compiler/implementation/ssa/nodes.dart:877: bool isConstantBoolean() => false; How did we live ...
8 years, 8 months ago (2012-04-26 07:24:02 UTC) #2
floitsch
LGTM. Please add tests for the types I mentioned. conflicting phi types, 0 === 0.0 ...
8 years, 8 months ago (2012-04-26 08:31:15 UTC) #3
ngeoffray
http://codereview.chromium.org/10174040/diff/1/lib/compiler/implementation/ssa/optimize.dart File lib/compiler/implementation/ssa/optimize.dart (right): http://codereview.chromium.org/10174040/diff/1/lib/compiler/implementation/ssa/optimize.dart#newcode296 lib/compiler/implementation/ssa/optimize.dart:296: HInstruction handleIdentityCheck(HInvokeBinary node) { On 2012/04/26 07:24:02, Lasse Reichstein ...
8 years, 8 months ago (2012-04-26 09:25:19 UTC) #4
ngeoffray
8 years, 8 months ago (2012-04-26 10:09:53 UTC) #5
http://codereview.chromium.org/10174040/diff/1/lib/compiler/implementation/ss...
File lib/compiler/implementation/ssa/optimize.dart (right):

http://codereview.chromium.org/10174040/diff/1/lib/compiler/implementation/ss...
lib/compiler/implementation/ssa/optimize.dart:300: return
graph.addConstantBool(false);
On 2012/04/26 09:25:19, ngeoffray wrote:
> On 2012/04/26 08:31:16, floitsch wrote:
> > I don't think this is correct: A phi with inputs integer and string will say
> > that its input is conflicting.
> > var x = 3;
> > while (true) { if (x == "done") return; x = done; }
> 
> I'm not sure I understand how this relates to the code.

Actually, it looks like a phi never gets a conflicting type: see
HPhi::computeTypeFromInputTypes in nodes.dart. I added a test still and some
asserts, to make sure we don't regress on that case.

Powered by Google App Engine
This is Rietveld 408576698